未验证 提交 82839c60 编写于 作者: P Pine 提交者: GitHub

Merge branch 'master' into pine/openerservice

...@@ -109,7 +109,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor ...@@ -109,7 +109,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
) { ) {
super(KeybindingsEditor.ID, telemetryService, themeService, storageService); super(KeybindingsEditor.ID, telemetryService, themeService, storageService);
this.delayedFiltering = new Delayer<void>(300); this.delayedFiltering = new Delayer<void>(300);
this._register(keybindingsService.onDidUpdateKeybindings(() => this.render(true))); this._register(keybindingsService.onDidUpdateKeybindings(() => this.render(!!this.keybindingFocusContextKey.get())));
this.keybindingsEditorContextKey = CONTEXT_KEYBINDINGS_EDITOR.bindTo(this.contextKeyService); this.keybindingsEditorContextKey = CONTEXT_KEYBINDINGS_EDITOR.bindTo(this.contextKeyService);
this.searchFocusContextKey = CONTEXT_KEYBINDINGS_SEARCH_FOCUS.bindTo(this.contextKeyService); this.searchFocusContextKey = CONTEXT_KEYBINDINGS_SEARCH_FOCUS.bindTo(this.contextKeyService);
...@@ -537,7 +537,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor ...@@ -537,7 +537,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
} }
this.unAssignedKeybindingItemToRevealAndFocus = null; this.unAssignedKeybindingItemToRevealAndFocus = null;
} else if (currentSelectedIndex !== -1 && currentSelectedIndex < this.listEntries.length) { } else if (currentSelectedIndex !== -1 && currentSelectedIndex < this.listEntries.length) {
this.selectEntry(currentSelectedIndex); this.selectEntry(currentSelectedIndex, preserveFocus);
} else if (this.editorService.activeControl === this && !preserveFocus) { } else if (this.editorService.activeControl === this && !preserveFocus) {
this.focus(); this.focus();
} }
...@@ -597,11 +597,13 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor ...@@ -597,11 +597,13 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
return -1; return -1;
} }
private selectEntry(keybindingItemEntry: IKeybindingItemEntry | number): void { private selectEntry(keybindingItemEntry: IKeybindingItemEntry | number, focus: boolean = true): void {
const index = typeof keybindingItemEntry === 'number' ? keybindingItemEntry : this.getIndexOf(keybindingItemEntry); const index = typeof keybindingItemEntry === 'number' ? keybindingItemEntry : this.getIndexOf(keybindingItemEntry);
if (index !== -1) { if (index !== -1) {
if (focus) {
this.keybindingsList.getHTMLElement().focus(); this.keybindingsList.getHTMLElement().focus();
this.keybindingsList.setFocus([index]); this.keybindingsList.setFocus([index]);
}
this.keybindingsList.setSelection([index]); this.keybindingsList.setSelection([index]);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册