Skip to content

Commit 4d920ba

Browse files
authored
on escape, run command to dismiss inline suggestion/NES without affecting keybindings in package.json (#9624)
* keybindings: revert change to `escape` keybinding when clause * on escape, run command to dismiss inline suggestion/NES
1 parent faf7484 commit 4d920ba

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
{
6868
"key": "Escape",
6969
"command": "extension.vim_escape",
70-
"when": "editorTextFocus && vim.active && !inDebugRepl && !inlineSuggestionVisible && !inlineEditIsVisible && !testing.isPeekVisible && !testing.isInPeek && !suggestWidgetVisible && !dirtyDiffVisible && (vim.mode == 'Insert' || !notebookEditorFocused)"
70+
"when": "editorTextFocus && vim.active && !inDebugRepl"
7171
},
7272
{
7373
"key": "Escape",

src/actions/commands/actions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ class CommandEsc extends BaseCommand {
448448
vscode.commands.executeCommand('closeReferenceSearchEditor'),
449449
vscode.commands.executeCommand('closeMarkersNavigation'),
450450
vscode.commands.executeCommand('closeDirtyDiff'),
451+
vscode.commands.executeCommand('editor.action.inlineSuggest.hide'),
451452
]);
452453
}
453454
} else {

src/actions/commands/insert.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class CommandEscInsertMode extends BaseCommand {
3939

4040
public override async exec(position: Position, vimState: VimState): Promise<void> {
4141
void vscode.commands.executeCommand('closeParameterHints');
42+
void vscode.commands.executeCommand('editor.action.inlineSuggest.hide');
4243

4344
vimState.cursors = vimState.cursors.map((x) => x.withNewStop(x.stop.getLeft()));
4445
if (vimState.returnToInsertAfterCommand && position.character !== 0) {

0 commit comments

Comments
 (0)