helix
helix copied to clipboard
CTRL+K (kill_to_line_end) selects autocomplete option
Summary
When I go to insert mode on code that pops up the autocomplete list I can't do CTRL+K (kill_to_line_end), instead it selects an option from the autocomplete menu and inserts into the editor. On a comment for example where there's no autocomplete options, CTRL+K works as expected.
Reproduction Steps
I tried this:
cd helix# clone of helix repohx helix-core/src/diagnostic.rs- Put cursor on something that will autocomplete, for example on the
iinusize - Go to insert mode
- See the autocomplete menu popup with
uscompletions likeusize2xetc - Press CTRL+K to kill to end of line
I expected this to happen: The characters after the cursor to be deleted
Instead, this happened:
usize is replaced with the last item in the autocomplete list usizex8
Helix log
Nothing relevant in the log
Platform
macOS
Terminal Emulator
iTerm2
Helix Version
helix 22.05 (06a5bca7)
(Misclick sorry 😅)
Can you reproduce this on master? It looks like you're on a branch based on #2377
I can reproduce this more or less on master (59b886cf5e89dadfd73d93b638b2c552ce5537f6). Found out about CTRL+k today but everytime before I use it the LSP pops up with the suggestions and CTRL+k inserts the first suggestion from the list.
Tested in elixir files using elixir-ls.
- Switching to insert mode:

- Clicking CTRL+k

I'm new to the codebase so I could be wrong, but it seems that whenever the completion menu pops up, it takes precedence in handling certain key commands such as C-k (kill to end of line) ,C-j (insert newline), tab, etc. The workaround is to press C-c to exit the completion menu first. (check the menu file for input handling info).
There was a similar issue with pickers at one point, where C-k navigation overwrote the intended behavior of C-k killing to end of line in the prompt. This was addressed by https://github.com/helix-editor/helix/pull/1792, made a new PR https://github.com/helix-editor/helix/pull/5070 to try and resolve this for the completion menu as well
Fixed in https://github.com/helix-editor/helix/pull/5070