Skip to content

Commit c9a90bc

Browse files
committed
Parameter hints should restore editor focus after using buttons
Fixes microsoft#65435
1 parent c90f92f commit c9a90bc

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/vs/editor/contrib/parameterHints/parameterHints.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ registerEditorCommand(new ParameterHintsCommand({
9898
handler: x => x.cancel(),
9999
kbOpts: {
100100
weight: weight,
101-
kbExpr: EditorContextKeys.editorTextFocus,
101+
kbExpr: EditorContextKeys.focus,
102102
primary: KeyCode.Escape,
103103
secondary: [KeyMod.Shift | KeyCode.Escape]
104104
}
@@ -109,7 +109,7 @@ registerEditorCommand(new ParameterHintsCommand({
109109
handler: x => x.previous(),
110110
kbOpts: {
111111
weight: weight,
112-
kbExpr: EditorContextKeys.editorTextFocus,
112+
kbExpr: EditorContextKeys.focus,
113113
primary: KeyCode.UpArrow,
114114
secondary: [KeyMod.Alt | KeyCode.UpArrow],
115115
mac: { primary: KeyCode.UpArrow, secondary: [KeyMod.Alt | KeyCode.UpArrow, KeyMod.WinCtrl | KeyCode.KEY_P] }
@@ -121,7 +121,7 @@ registerEditorCommand(new ParameterHintsCommand({
121121
handler: x => x.next(),
122122
kbOpts: {
123123
weight: weight,
124-
kbExpr: EditorContextKeys.editorTextFocus,
124+
kbExpr: EditorContextKeys.focus,
125125
primary: KeyCode.DownArrow,
126126
secondary: [KeyMod.Alt | KeyCode.DownArrow],
127127
mac: { primary: KeyCode.DownArrow, secondary: [KeyMod.Alt | KeyCode.DownArrow, KeyMod.WinCtrl | KeyCode.KEY_N] }

src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,14 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable {
284284

285285
next(): void {
286286
if (this.model) {
287+
this.editor.focus();
287288
this.model.next();
288289
}
289290
}
290291

291292
previous(): void {
292293
if (this.model) {
294+
this.editor.focus();
293295
this.model.previous();
294296
}
295297
}

0 commit comments

Comments
 (0)