feature: Override vim.ui.select with a nui menu (very basic implementation shown) #798
Open
1 task done
Labels
enhancement
New feature or request
Did you check the docs?
Is your feature request related to a problem? Please describe.
Whether using notify or mini as the message mechanism, it's a little disconcerting to have the selection dialog appear in the same place as your notifications, and have no visual indication of escaping out/selecting an item. I've tried doing this myself, and it works okay, but I think integrating it into noice as a preset or something would be "noice". 🙃
Describe the solution you'd like
Since the nui menu is pretty robust, I think just the ability to create a menu at the cursor or at an arbitrary position on the screen whenever
vim.ui.select()
is called would be enough. The reason I care about cursor position is forvim.lsp.buf.code_action()
, which I use a lot, so that eye position is maintained.Describe alternatives you've considered
I guess custom creating a menu from scratch, or a special input buffer would be an alternative? But the nui menu seems like a pretty 1:1 layer between inputs, so I don't see anything that would be too much better. I guess you could make the selection menu part of the configuration options if there are multiple ways to implement it.
Additional context
Here's a very basic 1-afternoon implementation of what I mean (note that I am no lua whiz):
This implementation works with both
vim.lsp.buf.code_action()
and the string example keymapped below, which should mean that it works with both the table and string versions of nui'sMenu
.The text was updated successfully, but these errors were encountered: