You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While trying to make a quick menu for nvim's LSP, I ran into the following issue: if you select some text and open vim.ui.* using dressing, the visual selection is lost.
System information
OS: Linux
Neovim version: 0.8.1
Is this related to a specific vim.ui.select backend? If so, which one? Tested on vim.ui.select and vim.ui.input
Dressing config:
require("dressing").setup{}
To Reproduce
Steps to reproduce the behavior:
Open a file containing some text
Select some text in visual mode (I usually use line-selection out of habit)
Trigger vim.ui in any way, the most "minimal code" i can provide is the following command
Unfortunately, this is just how vim works. When you open fzf, that puts your cursor inside of a terminal window in insert mode (technically, in "terminal" mode). There's no way to also have your cursor be in the original window with a visual mode selection. You could potentially save the current visual selection before calling vim.ui.select, or you could restore the selection after vim.ui.select completes with vim.cmd.normal({args = {"gv"}}), but there's no way to preserve that visual selection while doing anything else with your cursor.
I understand. I thought it was an issue because the normal vim.ui seemed to keep the visual selection "active in background" (although probably only visually) and restore it after the task was completed.
Thank you for the clarification, feel free to close this ticket!
The built-in vim.ui methods use synchronous input functions that block Neovim. All other rendering is paused while waiting for input() or inputlist(). This can be helpful if you really do need the user to input something before you continue execution, but you'll want to manually use vim.fn.inputlist if that's what you're after, since vim.ui.select is designed to work async.
Describe the bug
While trying to make a quick menu for nvim's LSP, I ran into the following issue: if you select some text and open vim.ui.* using dressing, the visual selection is lost.
System information
vim.ui.select
backend? If so, which one? Tested on vim.ui.select and vim.ui.inputTo Reproduce
Steps to reproduce the behavior:
Additional context
I tried disabling the plugin and using the native vim.ui.select and the selection is kept.
I'm using the fzf backend with
ibhagwan/fzf-lua
.I'm available for any question!
The text was updated successfully, but these errors were encountered: