Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb7c757

Browse files
authored
Merge pull request#133682 from justanotheranonymoususer/view-command-preserve-focus
Option to preserve focus while showing view
2 parents4f9022b +f1a2ed1 commitbb7c757

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

‎src/vs/workbench/browser/parts/views/viewsService.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,10 @@ export class ViewsService extends Disposable implements IViewsService {
457457
privateregisterFocusViewAction(viewDescriptor:IViewDescriptor,category?:string|ILocalizedString):IDisposable{
458458
returnregisterAction2(classFocusViewActionextendsAction2{
459459
constructor(){
460+
consttitle=localize({key:'focus view',comment:['{0} indicates the name of the view to be focused.']},"Focus on {0} View",viewDescriptor.name);
460461
super({
461462
id:viewDescriptor.focusCommand ?viewDescriptor.focusCommand.id :`${viewDescriptor.id}.focus`,
462-
title:{original:`Focus on${viewDescriptor.name} View`,value:localize({key:'focus view',comment:['{0} indicates the name of the view to be focused.']},"Focus on {0} View",viewDescriptor.name)},
463+
title:{original:`Focus on${viewDescriptor.name} View`,value:title},
463464
category,
464465
menu:[{
465466
id:MenuId.CommandPalette,
@@ -473,11 +474,29 @@ export class ViewsService extends Disposable implements IViewsService {
473474
linux:viewDescriptor.focusCommand?.keybindings?.linux,
474475
mac:viewDescriptor.focusCommand?.keybindings?.mac,
475476
win:viewDescriptor.focusCommand?.keybindings?.win
477+
},
478+
description:{
479+
description:title,
480+
args:[
481+
{
482+
name:'focusOptions',
483+
description:'Focus Options',
484+
schema:{
485+
type:'object',
486+
properties:{
487+
'preserveFocus':{
488+
type:'boolean',
489+
default:false
490+
}
491+
},
492+
}
493+
}
494+
]
476495
}
477496
});
478497
}
479-
run(accessor:ServicesAccessor):void{
480-
accessor.get(IViewsService).openView(viewDescriptor.id,true);
498+
run(accessor:ServicesAccessor,showOptions?:{preserveFocus?:boolean}):void{
499+
accessor.get(IViewsService).openView(viewDescriptor.id,!preserveFocus);
481500
}
482501
});
483502
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp