@@ -12,7 +12,7 @@ import { CommentReply, findActiveHandler, resolveCommentHandler } from './commen
1212import { COPILOT_LOGINS } from './common/copilot' ;
1313import { commands } from './common/executeCommands' ;
1414import Logger from './common/logger' ;
15- import { FILE_LIST_LAYOUT , PR_SETTINGS_NAMESPACE } from './common/settingKeys' ;
15+ import { CLOSE_ON_MARK_FILE_AS_VIEWED , FILE_LIST_LAYOUT , PR_SETTINGS_NAMESPACE } from './common/settingKeys' ;
1616import { editQuery } from './common/settingsUtils' ;
1717import { ITelemetry } from './common/telemetry' ;
1818import { asTempStorageURI , fromPRUri , fromReviewUri , Schemes , toPRUri } from './common/uri' ;
@@ -1356,7 +1356,7 @@ ${contents}
13561356 } ;
13571357
13581358 context . subscriptions . push (
1359- vscode . commands . registerCommand ( 'pr.markFileAsViewed' , async ( treeNode : FileChangeNode | vscode . Uri | undefined , args ?: { closeFile ?: boolean } ) => {
1359+ vscode . commands . registerCommand ( 'pr.markFileAsViewed' , async ( treeNode : FileChangeNode | vscode . Uri | undefined ) => {
13601360 try {
13611361 if ( treeNode === undefined ) {
13621362 // Use the active editor to enable keybindings
@@ -1366,9 +1366,10 @@ ${contents}
13661366 if ( treeNode instanceof FileChangeNode ) {
13671367 await treeNode . markFileAsViewed ( false ) ;
13681368 } else if ( treeNode ) {
1369- // When the argument is a uri it came from the editor menu. By default we don't close the editor
1370- // but this can be controlled by the command argument
1371- const shouldCloseEditor = args ?. closeFile ?? false ;
1369+ // When the argument is a uri it came from the editor menu. By default we close the editor
1370+ // after marking the file as viewed, but this can be controlled by a setting.
1371+ const shouldCloseEditor = vscode . workspace . getConfiguration ( PR_SETTINGS_NAMESPACE )
1372+ . get < boolean > ( CLOSE_ON_MARK_FILE_AS_VIEWED , true ) ;
13721373 if ( shouldCloseEditor ) {
13731374 // Do the close first to improve perceived performance of marking as viewed.
13741375 const tab = vscode . window . tabGroups . activeTabGroup . activeTab ;
0 commit comments