File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -484,14 +484,18 @@ async function onSwitchHeaderSource(): Promise<void> {
484
484
}
485
485
} ) ;
486
486
const document : vscode . TextDocument = await vscode . workspace . openTextDocument ( targetFileName ) ;
487
+ const workbenchConfig : vscode . WorkspaceConfiguration = vscode . workspace . getConfiguration ( "workbench" ) ;
487
488
let foundEditor : boolean = false ;
488
- // If the document is already visible in another column, open it there.
489
- vscode . window . visibleTextEditors . forEach ( ( editor , index , array ) => {
490
- if ( editor . document === document && ! foundEditor ) {
491
- foundEditor = true ;
492
- vscode . window . showTextDocument ( document , editor . viewColumn ) ;
493
- }
494
- } ) ;
489
+ if ( workbenchConfig . get ( "editor.revealIfOpen" ) ) {
490
+ // If the document is already visible in another column, open it there.
491
+ vscode . window . visibleTextEditors . forEach ( editor => {
492
+ if ( editor . document === document && ! foundEditor ) {
493
+ foundEditor = true ;
494
+ vscode . window . showTextDocument ( document , editor . viewColumn ) ;
495
+ }
496
+ } ) ;
497
+ }
498
+
495
499
if ( ! foundEditor ) {
496
500
vscode . window . showTextDocument ( document ) ;
497
501
}
You can’t perform that action at this time.
0 commit comments