diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:39:54 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-29 22:39:54 +0000 |
commit | 21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch) | |
tree | 84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /runtime/doc/ui.txt | |
parent | d9c904f85a23a496df4eb6be42aa43f007b22d50 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-colorcolchar.tar.gz rneovim-colorcolchar.tar.bz2 rneovim-colorcolchar.zip |
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'runtime/doc/ui.txt')
-rw-r--r-- | runtime/doc/ui.txt | 76 |
1 files changed, 48 insertions, 28 deletions
diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 3110d0817c..ab99b0446f 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -52,12 +52,10 @@ with these (optional) keys: - `ext_termcolors` Use external default colors. - `term_name` Sets the name of the terminal 'term'. - `term_colors` Sets the number of supported colors 't_Co'. -- `term_background` Sets the default value of 'background'. -- `stdin_fd` Read buffer from `fd` as if it was a stdin pipe - This option can only used by |--embed| ui, - see |ui-startup-stdin|. - `stdin_tty` Tells if `stdin` is a `tty` or not. - `stdout_tty` Tells if `stdout` is a `tty` or not. +- `stdin_fd` Read buffer 1 from this fd as if it were stdin |--|. + Only from |--embed| UI on startup. |ui-startup-stdin| +- `stdin_tty` Tells if `stdin` is a `tty` or not. +- `stdout_tty` Tells if `stdout` is a `tty` or not. Specifying an unknown option is an error; UIs can check the |api-metadata| `ui_options` key for supported options. @@ -79,14 +77,14 @@ Example of a typical "redraw" batch in a single RPC notification: > [ ['grid_resize', [2, 77, 36]], ['grid_line', - [2, 0, 0, [[' ' , 0, 77]]], - [2, 1, 0, [['~', 7], [' ', 7, 76]]], - [2, 9, 0, [['~', 7], [' ', 7, 76]]], + [2, 0, 0, [[' ' , 0, 77]], false], + [2, 1, 0, [['~', 7], [' ', 7, 76]], false], + [2, 9, 0, [['~', 7], [' ', 7, 76]], false], ... - [2, 35, 0, [['~', 7], [' ', 7, 76]]], - [1, 36, 0, [['[', 9], ['N'], ['o'], [' '], ['N'], ['a'], ['m'], ['e'], [']']]], - [1, 36, 9, [[' ', 9, 50]]], - [1, 36, 59, [['0', 9], [','], ['0'], ['-' ], ['1'], [' ', 9, 10], ['A'], ['l', 9, 2]]] + [2, 35, 0, [['~', 7], [' ', 7, 76]], false], + [1, 36, 0, [['[', 9], ['N'], ['o'], [' '], ['N'], ['a'], ['m'], ['e'], [']']], false], + [1, 36, 9, [[' ', 9, 50]], false], + [1, 36, 59, [['0', 9], [','], ['0'], ['-' ], ['1'], [' ', 9, 10], ['A'], ['l', 9, 2]], false] ], ['msg_showmode', [[]]], ['win_pos', [2, 1000, 0, 0, 77, 36]], @@ -154,11 +152,11 @@ procedure: An UI can support the native read from stdin feature as invoked with `command | nvim -` for the builtin TUI. |--| The embedding process can detect that its stdin is open to a file which -not is a terminal, just like nvim does. It then needs to forward this fd +not is a terminal, just like Nvim does. It then needs to forward this fd to Nvim. As fd=0 is already is used to send rpc data from the embedder to Nvim, it needs to use some other file descriptor, like fd=3 or higher. -Then, `stdin_fd` option should be passed to `nvim_ui_attach` and nvim will +Then, `stdin_fd` option should be passed to `nvim_ui_attach` and Nvim will implicitly read it as a buffer. This option can only be used when Nvim is launched with `--embed` option, as described above. @@ -200,7 +198,7 @@ the editor. The following keys are deprecated: `hl_id`: Use `attr_id` instead. - `hl_lm`: Use `attr_id_lm` instead. + `id_lm`: Use `attr_id_lm` instead. ["option_set", name, value] ~ UI-related option changed, where `name` is one of: @@ -212,6 +210,7 @@ the editor. - 'guifontwide' - 'linespace' - 'mousefocus' + - 'mousehide' - 'mousemoveevent' - 'pumblend' - 'showtabline' @@ -337,7 +336,7 @@ numerical highlight ids to the actual attributes. Highlights are always transmitted both for both the RGB format and as terminal 256-color codes, as the `rgb_attr` and `cterm_attr` parameters - respectively. The |ui-rgb| option has no effect effect anymore. + respectively. The |ui-rgb| option has no effect anymore. Most external UIs will only need to store and use the `rgb_attr` attributes. @@ -353,15 +352,15 @@ numerical highlight ids to the actual attributes. |ui-hlstate| extension explained below. ["hl_group_set", name, hl_id] ~ - The bulitin highlight group `name` was set to use the attributes `hl_id` + The built-in highlight group `name` was set to use the attributes `hl_id` defined by a previous `hl_attr_define` call. This event is not needed to render the grids which use attribute ids directly, but is useful - for an UI who want to render its own elements with consistent - highlighting. For instance an UI using |ui-popupmenu| events, might + for a UI who want to render its own elements with consistent + highlighting. For instance a UI using |ui-popupmenu| events, might use the |hl-Pmenu| family of builtin highlights. *ui-event-grid_line* -["grid_line", grid, row, col_start, cells] ~ +["grid_line", grid, row, col_start, cells, wrap] ~ Redraw a continuous part of a `row` on a `grid`, starting at the column `col_start`. `cells` is an array of arrays each with 1 to 3 items: `[text(, hl_id, repeat)]` . `text` is the UTF-8 text that should be put in @@ -380,6 +379,12 @@ numerical highlight ids to the actual attributes. enough to cover the remaining line, will be sent when the rest of the line should be cleared. + `wrap` is a boolean indicating that this line wraps to the next row. + When redrawing a line which wraps to the next row, Nvim will emit a + `grid_line` event covering the last column of the line with `wrap` set + to true, followed immediately by a `grid_line` event starting at the + first column of the next row. + ["grid_clear", grid] ~ Clear a `grid`. @@ -429,7 +434,7 @@ numerical highlight ids to the actual attributes. +-------------------------+ < `cols` is always zero in this version of Nvim, and reserved for future - use. + use. Note when updating code from |ui-grid-old| events: ranges are end-exclusive, which is consistent with API conventions, but different @@ -532,7 +537,7 @@ is not active. New UIs should implement |ui-linegrid| instead. +-------------------------+ < ============================================================================== -Detailed highlight state Extension *ui-hlstate* +Detailed highlight state Extension *ui-hlstate* Activated by the `ext_hlstate` |ui-option|. Activates |ui-linegrid| implicitly. @@ -566,7 +571,7 @@ highlight group is cleared, so `ui_name` can always be used to reliably identify screen elements, even if no attributes have been applied. ============================================================================== -Multigrid Events *ui-multigrid* +Multigrid Events *ui-multigrid* Activated by the `ext_multigrid` |ui-option|. Activates |ui-linegrid| implicitly. @@ -627,15 +632,27 @@ tabs. When |ui-messages| is active, no message grid is used, and this event will not be sent. -["win_viewport", grid, win, topline, botline, curline, curcol] ~ +["win_viewport", grid, win, topline, botline, curline, curcol, line_count, scroll_delta] ~ Indicates the range of buffer text displayed in the window, as well as the cursor position in the buffer. All positions are zero-based. `botline` is set to one more than the line count of the buffer, if - there are filler lines past the end. + there are filler lines past the end. `scroll_delta` contains how much + the top line of a window moved since `win_viewport` was last emitted. + It is intended to be used to implement smooth scrolling. For this + purpose it only counts "virtual" or "displayed" lines, so folds + only count as one line. When scrolling more than a full screen it is + an approximate value. + + All updates, such as `grid_line`, in a batch affects the new viewport, + despite the fact that `win_viewport` is received after the updates. + Applications implementing, for example, smooth scrolling should take + this into account and keep the grid separated from what's displayed on + the screen and copy it to the viewport destination once `win_viewport` + is received. ["win_extmark", grid, win, ns_id, mark_id, row, col] ~ Updates the position of an extmark which is currently visible in a - window. Only emitted if the mark has the `ui_watched` attribute. + window. Only emitted if the mark has the `ui_watched` attribute. ============================================================================== Popupmenu Events *ui-popupmenu* @@ -707,7 +724,7 @@ For command-line 'wildmenu' UI events, activate |ui-popupmenu|. 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 than the edited command line. + has a higher level than the edited command line. ["cmdline_pos", pos, level] ~ Change the cursor position in the cmdline. @@ -809,5 +826,8 @@ events, which the UI must handle. Sent when |:messages| command is invoked. History is sent as a list of entries, where each entry is a `[kind, content]` tuple. +["msg_history_clear"] ~ + Clear the |:messages| history. + ============================================================================== vim:tw=78:ts=8:noet:ft=help:norl: |