dressing.nvim
dressing.nvim copied to clipboard
Open menu before loading buffer
I am using a language server that I need to make a selection for before starting the server. Currently I can use the default way to select my option first and then the buffer loads. When using this plugin the buffer is not blocked from loading and I am unable to make the selection before the language server starts.
Is there anyway to expose an option to have the menu block loading a buffer until after the selection is made?
buffer is not loaded yet, there is time to make selection
buffer already loaded, too late to make selection
Unfortunately, there's no way to block it in the same way that inputlist()
would. When vim uses those built-in input commands, the whole editor more-or-less is paused while that resolves. Even if there were an API to do a similar pause, that would also block the rendering of the selection float.
That said, there are some other possibilities.
- You could conditionally disable the
vim.ui.select
patch and use the built-ininputlist()
function for this particular case. See #29 for more info. - Total hack, but you could play around with doing an immediate
bufwipe
orbufclose
, popping up the prompt, then reloading the buffer (with a flag to prevent an infinite loop). - If this is for LSP, you have the option to take more control over when the client attaches. You could pass
autostart = false
to your configuration and run:LspStart
once the selection completes.