diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2021-09-27 21:57:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-27 21:57:28 +0200 |
commit | 63fde086d9e7936b21c51e145253ec69820b2112 (patch) | |
tree | fe42e09315181b66e32b5787508f6bd81e719c67 /runtime/doc/lua.txt | |
parent | 6736ee8be5ae9a3b004bd9033d7efffad74a03be (diff) | |
download | rneovim-63fde086d9e7936b21c51e145253ec69820b2112.tar.gz rneovim-63fde086d9e7936b21c51e145253ec69820b2112.tar.bz2 rneovim-63fde086d9e7936b21c51e145253ec69820b2112.zip |
feat(ui): add vim.ui.select and use in code actions (#15771)
Continuation of https://github.com/neovim/neovim/pull/15202
A plugin like telescope could override it with a fancy implementation
and then users would get the telescope-ui within each plugin that
utilizes the vim.ui.select function.
There are some plugins which override the `textDocument/codeAction`
handler solely to provide a different UI. With custom client commands and
soon codeAction resolve support, it becomes more difficult to implement
the handler right - so having a dedicated way to override the picking
function will be useful.
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r-- | runtime/doc/lua.txt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 53d68fa5e6..22e323baa7 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1645,4 +1645,25 @@ uri_to_fname({uri}) *vim.uri_to_fname()* Return: ~ Filename + +============================================================================== +Lua module: ui *lua-ui* + +select({items}, {opts}, {on_choice}) *vim.ui.select()* + Prompts the user to pick a single item from a collection of + entries + + Parameters: ~ + {items} table Arbitrary items + {opts} table Additional options + • prompt (string|nil) Text of the prompt. + Defaults to `Select one of:` + • format_item (function item -> text) + Function to format an individual item from + `items` . Defaults to `tostring` . + {on_choice} function ((item|nil, idx|nil) -> ()) Called + once the user made a choice. `idx` is the + 1-based index of `item` within `item` . `nil` + if the user aborted the dialog. + vim:tw=78:ts=8:ft=help:norl: |