pub fn open<C, K, V>(
choices: impl IntoIterator<Item = C> + Debug,
opts: &(impl IntoIterator<Item = (K, V)> + Debug + Clone),
callback: impl Fn(usize) + 'static,
maybe_quickfix: Option<QuickfixConfig>,
) -> Result<()>Expand description
Prompts the user to select an item from a list using Nvim’s vim.ui.select.
Wraps the Lua vim.ui.select function to provide an interactive selection prompt.
The selected index (0-based) is passed to the provided callback. If a quickfix
configuration is provided, an additional synthetic choice is added to open the
quickfix list instead.
§Errors
- Fails if
vim.ui.selectcannot be fetched from Lua globals. - Fails if the options table cannot be created.
- Fails if calling
vim.ui.selectencounters an error.