Home Explore Blog CI



neovim

11th chunk of `runtime/doc/ui.txt`
d484a8ea70a4de7c155436c02a9475172ba31cfdb81402840000000100000fa1
 `ui_watched` attribute.

==============================================================================
Popupmenu Events						 *ui-popupmenu*

Activated by the `ext_popupmenu` |ui-option|.

This UI extension delegates presentation of the |popupmenu-completion| and
command-line 'wildmenu'.

The UI decides how to present the menu. For example, depending on the last
`mode_change` event, command-line wildmenu may be presented horizontally,
while insert-mode completion would show a vertical popupmenu.

["popupmenu_show", items, selected, row, col, grid] ~
	Show |popupmenu-completion|. `items` is an array of completion items
	to show; each item is an array of the form [word, kind, menu, info] as
	defined at |complete-items|, except that `word` is replaced by `abbr`
	if present.  `selected` is the initially-selected item, a zero-based
	index into the array of items (-1 if no item is selected). `row` and
	`col` give the anchor position, where the first character of the
	completed word will be. When |ui-multigrid| is used, `grid` is the
	grid for the anchor position. When `ext_cmdline` is active, `grid` is
	set to -1 to indicate the popupmenu should be anchored to the external
	cmdline. Then `col` will be a byte position in the cmdline text.

["popupmenu_select", selected] ~
	Select an item in the current popupmenu. `selected` is a zero-based
	index into the array of items from the last popupmenu_show event, or
	-1 if no item is selected.

["popupmenu_hide"] ~
	Hide the popupmenu.

==============================================================================
Tabline Events							   *ui-tabline*

Activated by the `ext_tabline` |ui-option|.

["tabline_update", curtab, tabs, curbuf, buffers] ~
	Tabline was updated. UIs should present this data in a custom tabline
	widget. Note: options `curbuf` + `buffers` were added in API7.
	curtab:   Current Tabpage
	tabs:     List of Dicts [{ "tab": Tabpage, "name": String }, ...]
	curbuf:   Current buffer handle.
	buffers:  List of Dicts [{ "buffer": buffer handle, "name": String}, ...]

==============================================================================
Cmdline Events							   *ui-cmdline*

Activated by the `ext_cmdline` |ui-option|.

This UI extension delegates presentation of the |cmdline| (except 'wildmenu').
For command-line 'wildmenu' UI events, activate |ui-popupmenu|.

["cmdline_show", content, pos, firstc, prompt, indent, level, hl_id] ~
        content: List of [attrs, string]
	         [[{}, "t"], [attrs, "est"], ...]

	Triggered when the cmdline is displayed or changed.
	The `content` is the full content that should be displayed in the
	cmdline, and the `pos` is the position of the cursor that in the
	cmdline. The content is divided into chunks with different highlight
	attributes represented as a dict (see |ui-event-highlight_set|).

	`firstc` and `prompt` are text, that if non-empty should be
	displayed in front of the command line. `firstc` always indicates
	built-in command lines such as `:` (ex command) and `/` `?` (search),
	while `prompt` is an |input()| prompt, highlighted with `hl_id`.
	`indent` tells how many spaces the content should be indented.

	The Nvim command line can be invoked recursively, for instance by
	typing `<c-r>=` at the command line prompt. The `level` field is used
	to distinguish different command lines active at the same time. The
	first invoked command line has level 1, the next recursively-invoked
	prompt has level 2. A command line invoked from the |cmdline-window|
	has a higher level than the edited command line.

["cmdline_pos", pos, level] ~
	Change the cursor position in the cmdline.

["cmdline_special_char", c, shift, level] ~
	Display a special char in the cmdline at the cursor position. This is
	typically used to indicate a pending state, e.g. after |c_CTRL-V|. If
	`shift` is true the text after the cursor should be shifted, otherwise
	it should overwrite the char at the cursor.

	Should be hidden at next cmdline_show.

["cmdline_hide",

Title: Popupmenu, Tabline, and Cmdline Events
Summary
Continues with Popupmenu events: `popupmenu_select` selects an item, and `popupmenu_hide` hides the menu. Proceeds to Tabline events, activated by `ext_tabline`, with `tabline_update` providing data for a custom tabline widget. Concludes with Cmdline events, activated by `ext_cmdline`, delegating cmdline presentation. Events include: `cmdline_show` displaying the cmdline content, cursor position, and prompt details; `cmdline_pos` changing the cursor position; and `cmdline_special_char` displaying special characters at the cursor position.