-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Moving around in insert mode triggers LSP completions; it shouldn’t #2027
Comments
Previous discussion: #1381. |
Given #2580 if this cannot be fixed natively within the design of Helix, perhaps the thing to do is to concede that insert mode only works on a single line and to force the editor to exit into normal mode whenever the person navigates to a different line using the up/down arrow keys. While this will require people to constantly go back and forth between insert and normal mode, this does appear to be the expectation from what I’ve been reading from the responses and by making it automatic, Helix would at least avoid the code corruptions that can result from moving between lines using the arrow keys in insert mode. The other way to avoid the corruptions would be to make tab and shift-tab be the only ways to navigate the autocompletion drop downs. Come to think of it, this might be the better solution. |
You shouldn't set Setting it to This same issue is present in kakoune. They offer an insert mode keybind: |
Although "correct" that doesn't help fix a common issue that many run into. If this is the stance of Helix, I think the arrow keys should be disabled for movement in insert mode. Thus forcing you to use it "right". A better solution would be to change the insert LSP suggestions to be selected by something other than arrow keys or perhaps via |
Also see the linked PR that will close this: #8021 |
Summary
LSP completions should only be triggered while typing, not when moving around in LSP mode. Otherwise, it is very easy to corrupt code when using the up/down arrows to move between lines.
Reproduction Steps
For easier reproduction, set
idle-timeout
to0
in your config.toml:Then, with the following basic JS example:
What should happen
The completion dialogue should not show and you should find yourself on line 1. The code on line 2 should remain unchanged.
What actually happens
The completion dialog shows and pressing the up arrow inserts the
continue
completion in the middle of theconsole
keyword so you end up with:Helix log
n/a
Platform
Linux (elementary OS 6; based on Ubuntu)
Terminal Emulator
io.elementary.t
Helix Version
helix 22.05-dev (2d4f94e)
The text was updated successfully, but these errors were encountered: