helix
helix copied to clipboard
edition.preview-completion-insert = false produces unexpected autocompletions
Summary
With this setting set to false in my config:
[editor]
preview-completion-insert = false
I expect that completions should not appear unless I use enter to select them. In actuality, I still need to use ctrl+c to cancel. Pressing Escape or navigation with the left or right arrow still inputs the highlighted text into the editor.
I still get autocompletions happening if I press . Only ctrl+c seems to cancel it properly.
Reproduction Steps
- Set the
preview-completion-insert = falseoption in the config - Open a file that you have an LSP available for with completions
- Trigger the completion menu
- Hover over an item in the menu
- Click esc/left-arrow/right-arrow
Helix log
~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines
Platform
MacOS
Terminal Emulator
kitty - version 0.25.2
Installation Method
brew
Helix Version
helix 23.10 (f6021dd0)
this is intentional all this does is prevent the preview when you select a completion. We still auto accept all completions when typing any character when one is selected
I see. I suppose my expectations for why I felt it was a bug is because with the inserted preview gone, the cursor now remains at the initial spot:
And so if I were to press backspace, I'd expect it to delete the character before that, but it instead inserts the suggestion first and deletes a character off of it:
Perhaps it's not the goal of preview-completion-insert in particular, but it would be nice if only Enter/Return triggered the completion. That would be more in-line with how VSCode, IntelliJ IDEs, nvim-cmp, Lapce, Zed, etc. behaves as well.
Sorry I missed this when checking for duplicates. If it is going to stay the default, could an additional setting be added to control this?
I would agree with OP here. @pascalkuthe even if the current behaviour is intentional, would you agree with removing the completion when Backspace/Delete/Esc are pressed?