mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
feat(ui): use builtin completion popupmenu with ext_cmdline (#31269)
Problem: UIs implementing ext_cmdline/message must also implement
ext_popupmenu in order to get cmdline completion with
wildoptions+=pum.
Solution: Allow marking a window as the ext_cmdline window through
nvim_open_win(), including prompt offset. Anchor the cmdline-
completion popupmenu to this window.
This commit is contained in:
@@ -3475,8 +3475,8 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()*
|
||||
like a tooltip near the buffer text).
|
||||
• row: Row position in units of "screen cell height", may be
|
||||
fractional.
|
||||
• col: Column position in units of "screen cell width", may
|
||||
be fractional.
|
||||
• col: Column position in units of screen cell width, may be
|
||||
fractional.
|
||||
• focusable: Enable focus by user actions (wincmds, mouse
|
||||
events). Defaults to true. Non-focusable windows can be
|
||||
entered by |nvim_set_current_win()|, or, when the `mouse`
|
||||
@@ -3558,6 +3558,9 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()*
|
||||
cursor will be invisible when focused on it.
|
||||
• vertical: Split vertically |:vertical|.
|
||||
• split: Split direction: "left", "right", "above", "below".
|
||||
• _cmdline_offset: (EXPERIMENTAL) When provided, anchor the
|
||||
|cmdline-completion| popupmenu to this window, with an
|
||||
offset in screen cell width.
|
||||
|
||||
Return: ~
|
||||
|window-ID|, or 0 on error
|
||||
|
||||
5
runtime/lua/vim/_meta/api.lua
generated
5
runtime/lua/vim/_meta/api.lua
generated
@@ -1771,8 +1771,7 @@ function vim.api.nvim_open_term(buffer, opts) end
|
||||
--- - `row=0` and `col=0` if `anchor` is "SW" or "SE"
|
||||
--- (thus like a tooltip near the buffer text).
|
||||
--- - row: Row position in units of "screen cell height", may be fractional.
|
||||
--- - col: Column position in units of "screen cell width", may be
|
||||
--- fractional.
|
||||
--- - col: Column position in units of screen cell width, may be fractional.
|
||||
--- - focusable: Enable focus by user actions (wincmds, mouse events).
|
||||
--- Defaults to true. Non-focusable windows can be entered by
|
||||
--- `nvim_set_current_win()`, or, when the `mouse` field is set to true,
|
||||
@@ -1852,6 +1851,8 @@ function vim.api.nvim_open_term(buffer, opts) end
|
||||
--- focused on it.
|
||||
--- - vertical: Split vertically `:vertical`.
|
||||
--- - split: Split direction: "left", "right", "above", "below".
|
||||
--- - _cmdline_offset: (EXPERIMENTAL) When provided, anchor the `cmdline-completion`
|
||||
--- popupmenu to this window, with an offset in screen cell width.
|
||||
--- @return integer # |window-ID|, or 0 on error
|
||||
function vim.api.nvim_open_win(buffer, enter, config) end
|
||||
|
||||
|
||||
1
runtime/lua/vim/_meta/api_keysets.lua
generated
1
runtime/lua/vim/_meta/api_keysets.lua
generated
@@ -312,6 +312,7 @@ error('Cannot require a meta file')
|
||||
--- @field noautocmd? boolean
|
||||
--- @field fixed? boolean
|
||||
--- @field hide? boolean
|
||||
--- @field _cmdline_offset? integer
|
||||
|
||||
--- @class vim.api.keyset.win_text_height
|
||||
--- @field start_row? integer
|
||||
|
||||
Reference in New Issue
Block a user