Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab and Escape do not work with Next Edit Suggestions #9490

Open
lcmen opened this issue Feb 17, 2025 · 4 comments
Open

Tab and Escape do not work with Next Edit Suggestions #9490

lcmen opened this issue Feb 17, 2025 · 4 comments

Comments

@lcmen
Copy link

lcmen commented Feb 17, 2025

Describe the bug

When new Next Edit Suggestions (currently in Preview) is enabled. Tab and Escape to Accept / Reject Next Edit Suggestion does not do anything.

To Reproduce
Steps to reproduce the behavior:

  1. Enable github.copilot.nextEditSuggestions.enabled
  2. Change a code so Next Edit Suggestions icon appears
  3. Try to hit Tab or Escape

Expected behavior

Tab accepts next edit suggestion, Escape reject next edit suggestion.

  • Extension (VsCodeVim) version: 1.29.0
  • VSCode version: Version: 1.97.2
  • OS: MacOS Sonoma
@tramsi
Copy link

tramsi commented Feb 18, 2025

@lcmen I found a temporary solution just to increase the precedence of the copilot next edit suggestions keybindings
just add the following to your user keybindings.json
[ { "key": "tab", "command": "editor.action.inlineSuggest.commit", "when": "inlineEditIsVisible && tabShouldAcceptInlineEdit && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible || inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible || inlineEditIsVisible && inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestionVisible && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible || inlineEditIsVisible && inlineSuggestionVisible && tabShouldAcceptInlineEdit && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible" }, { "key": "tab", "command": "editor.action.inlineSuggest.commit", "when": "inInlineEditsPreviewEditor" }, { "key": "tab", "command": "editor.action.inlineSuggest.jump", "when": "inlineEditIsVisible && tabShouldJumpToInlineEdit && !editorHoverFocused && !editorTabMovesFocus && !suggestWidgetVisible" }, { "key": "escape", "command": "editor.action.inlineSuggest.hide", "when": "inInlineEditsPreviewEditor" }, { "key": "escape", "command": "editor.action.inlineSuggest.hide", "when": "inlineEditIsVisible || inlineSuggestionVisible" } ]

BTW these are the default key bindings for this commands, but I found if I added them to the keybindings.json file they would override vim's extensions commands conflicted with them

@baldwin-law
Copy link

You can set an alternative key binding in keybinding.json : { "key": "cmd+escape", "command": "editor.action.inlineSuggest.hide", }, { "key": "tab", "command": "-extension.vim_tab", }

@lcmen
Copy link
Author

lcmen commented Feb 19, 2025

@tramsi but I don't even know what all these conditions are for 😄 . I will try @baldwin-law approach for now as it's much easier to understand. Thank you guys for workarounds!

@tramsi
Copy link

tramsi commented Feb 19, 2025

It is just copying the default commands from vscode shortcut bindings and pasting them in the user bindings, that will ensure they will override vim's bindings

Image

this is the user bindings I pasted to you, but formatted:
Image

Anyway feel free to use whatever would work with you, I initially handled it like baldwin-law, but my muscle memory prefers only "esc" for the action :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants