Feature: show menu after backspace
Feature Description
Hitting backspace should re-trigger the menu (like nvim-cmp)
Ex (| is cursor):
print|
then press backspace (<BS>)
Should result in prin| with a menu popup
Probably should have exceptions (like don't show menu when whitespace), can maybe see how nvim-cmp handles that and mimic it.
We intentionally don't show the menu in this case. I'd be open to reviewing a PR that adds opt-in support for it (file to change).
@Saghen Unfortunately I am not so experienced in making nvim plugins, I am willing to try and help in what I can, would appreciate any help from you or other people.
Option can be something like completion.trigger.show_on_backspace = false (so it's opt-in)
Also as a side note, I find it quite confusing what you categorize as "not planned", like if the user had some configuration issue/bug that is fixable on their side, you'd often mark it as "not planned", I think just closing it is more clear (because I assume "oh this feature/bug is not being fixed" and then I have to go into the issue to see, oh it's just a fixable issue). At least for me, it'd make the most sense to only mark "not planned" issues if it's a feature/bug that is not fixable on the user side AND it's not going to be fixed/added.
Yeah I get you, but I'm following the same methodology as neovim, where if it isn't a planned feature or an issue with blink.cmp itself, then I close it as not planned.
Fair I guess, also maybe reopen this issue so even if you don't work on it, maybe someone else will? (maybe have a label for "contribution welcome" for things you won't work on, but open to merge)
I have a similar need.
I think this opportunity to customize this behavior will improve the UX.
This is a feature that I like, so I would also be interested in helping out
@Kyren223 Are you interested in working on this together?
@mcauley-penney Unfortunately I am busy at the moment, I won't be able to dedicate any time to this. Would be very grateful if you end up implementing this!
So, I've played around with this for several hours and I think I have something interesting. I apologize for posting then deleting messages, as well as for editing this one so many times. I kind of used this as a way to rubber duck besides posting updates.
Below is a GIF of where I'm at right now. I'll explain the features below the GIF.
- We can backspace after accepting a completion,
- we can backspace through trigger characters as long as they aren't spaces,
- the menu is hidden when we are on a space,
- the menu is hidden after an acceptance.
I had something basic up and running, but I found that it was incredibly annoying having the menu continue to show up suggesting the word you just accepted right after you accepted it. I haven't used nvim-cmp in a long while, so I can't remember what its behavior is like, but I think this is a good starting point. Please chime in and let me know what you think. If this is interesting to everybody, I can open a PR.
This is a good starting point, thanks for working on it.
For the showing completions you just accepted, I recommend just having it be an option with the default matching nvim-cmp behavior.
Also I am writing this on a phone, and the completion there does show the existing completion like "behavior." Delete the . And it shows "behavior" along with "behav" and "behave"
I'll go back and play with nvim-cmp today to see how it acts, then come back to this and update it to be exact.
For the showing completions you just accepted, I recommend just having it be an option with the default matching nvim-cmp behavior.
The default nvim-cmp behavior is to not display them, that I can tell. I opened VSCode and found that it doesn't do this either. The behavior that I implemented in blink for the GIF above actually matches cmp, which I didn't realize at the time. I just need to add a user configuration option and then this is actually ready to go as a PR.
Edit: see #1813
We can safely close this issue since PR #1813 got merged 5 days ago :)