feat(api): nvim_select_popupmenu_item support cmdline pum (#20652)

This commit is contained in:
zeertzjq
2022-10-17 21:00:50 +08:00
committed by GitHub
parent 39911d76be
commit 637ab296cb
12 changed files with 386 additions and 192 deletions

View File

@@ -1908,19 +1908,20 @@ Object nvim_get_proc(Integer pid, Error *err)
return rvobj;
}
/// Selects an item in the completion popupmenu.
/// Selects an item in the completion popup menu.
///
/// If |ins-completion| is not active this API call is silently ignored.
/// Useful for an external UI using |ui-popupmenu| to control the popupmenu
/// with the mouse. Can also be used in a mapping; use <cmd> |:map-cmd| to
/// ensure the mapping doesn't end completion mode.
/// If neither |ins-completion| nor |cmdline-completion| popup menu is active
/// this API call is silently ignored.
/// Useful for an external UI using |ui-popupmenu| to control the popup menu with the mouse.
/// Can also be used in a mapping; use <Cmd> |:map-cmd| or a Lua mapping to ensure the mapping
/// doesn't end completion mode.
///
/// @param item Index (zero-based) of the item to select. Value of -1 selects
/// nothing and restores the original text.
/// @param insert Whether the selection should be inserted in the buffer.
/// @param finish Finish the completion and dismiss the popupmenu. Implies
/// `insert`.
/// @param opts Optional parameters. Reserved for future use.
/// @param item Index (zero-based) of the item to select. Value of -1 selects nothing
/// and restores the original text.
/// @param insert For |ins-completion|, whether the selection should be inserted in the buffer.
/// Ignored for |cmdline-completion|.
/// @param finish Finish the completion and dismiss the popup menu. Implies {insert}.
/// @param opts Optional parameters. Reserved for future use.
/// @param[out] err Error details, if any
void nvim_select_popupmenu_item(Integer item, Boolean insert, Boolean finish, Dictionary opts,
Error *err)