From 344a1ee8e6b7d78120f8393d1babfd285e866334 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 22 Feb 2023 00:07:26 +0800 Subject: docs: fix typos (#22353) --- runtime/doc/ui.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 3110d0817c..4e4f88f275 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -53,11 +53,11 @@ with these (optional) keys: - `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 from `fd` as if it was a stdin pipe. + This option can only used by |--embed| ui on startup. + See |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. @@ -154,11 +154,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. @@ -356,8 +356,8 @@ numerical highlight ids to the actual attributes. The bulitin 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* @@ -532,7 +532,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 +566,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. -- cgit From 6752f1005d26c93a033d856a60b7b296f3e51634 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 14 Dec 2022 19:58:18 +0100 Subject: docs: naming conventions, guidelines close #21063 --- runtime/doc/ui.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 4e4f88f275..bb567e021e 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -809,5 +809,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: -- cgit From 7f424e2b65779c59fc0cac3cc7508ba2ec07f200 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 23 Feb 2023 18:29:36 +0100 Subject: feat(api): more fields in nvim_list_uis Problem: nvim_list_uis does not report all ":help ui-option" fields. Solution: Store ":help ui-option" fields on the `UI` object and update ui_array. --- runtime/doc/ui.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index bb567e021e..e706e36374 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -53,9 +53,8 @@ with these (optional) keys: - `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 on startup. - See |ui-startup-stdin|. +- `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. -- cgit From fd2ece278b0941ec6673489e88868120e86b834a Mon Sep 17 00:00:00 2001 From: Matthias Deiml Date: Sun, 12 Mar 2023 23:58:46 +0100 Subject: feat(ui): add scroll_delta to win_viewport event #19270 scroll_delta contains how much the top line of a window moved since the last time win_viewport was emitted. It is expected to be used to implement smooth scrolling. For this purpose it only counts "virtual" or "displayed" so folds should count as one line. Because of this it adds extra information that cannot be computed from the topline parameter. Fixes #19227 --- runtime/doc/ui.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index e706e36374..4ff74714f3 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -626,11 +626,15 @@ 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. ["win_extmark", grid, win, ns_id, mark_id, row, col] ~ Updates the position of an extmark which is currently visible in a -- cgit From 08991b078267e5de0a19a136d00d4f71ad651a32 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sat, 13 May 2023 21:33:22 +0200 Subject: docs: small fixes Co-authored-by: Christian Clason Co-authored-by: Gregory Anders Co-authored-by: HiPhish Co-authored-by: Julio B Co-authored-by: T727 <74924917+T-727@users.noreply.github.com> Co-authored-by: camoz Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com> --- runtime/doc/ui.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 4ff74714f3..c64c450aa1 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -336,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. @@ -352,7 +352,7 @@ 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 a UI who want to render its own elements with consistent @@ -710,7 +710,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. -- cgit From 981acc2922ce9a5f214ba14acbb1e444748855f2 Mon Sep 17 00:00:00 2001 From: Ricky Zhou Date: Thu, 1 Jun 2023 02:15:14 -0700 Subject: fix(ui): propagate line wrapping state on grid_line events This fixes the TUI's line-wrapping behavior, which was broken with the migration to the msgpack-based UI protocol (see https://github.com/neovim/neovim/issues/7369#issuecomment-1571812273). --- runtime/doc/ui.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index c64c450aa1..d3bd82ba27 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -78,14 +78,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]], @@ -360,7 +360,7 @@ numerical highlight ids to the actual attributes. 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 @@ -379,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`. -- cgit From cee981bf09c81ab4b2fe6facf45076ea4bac46a5 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 19 Jun 2023 02:24:44 -0700 Subject: docs #22363 Co-authored by: zeertzjq Co-authored by: Steven Todd McIntyre II <114119064+stmii@users.noreply.github.com> Co-authored by: nobe4 - docs: mention --luadev-mod to run with lua runtime files When changing a lua file in the ./runtime folder, a new contributor might expect changes to be applied to the built Neovim binary. --- runtime/doc/ui.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index c64c450aa1..1391ef2808 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -199,7 +199,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: -- cgit From a76b689b479e89d6feae687443d13ec38602a1a6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 4 Jul 2023 16:48:53 +0800 Subject: perf(ui-ext): approximate scroll_delta when scrolling too much (#24234) --- runtime/doc/ui.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 360189e928..ead5e31e32 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -640,7 +640,8 @@ tabs. 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. + only count as one line. When scrolling more than a full screen it is + an approximate value. ["win_extmark", grid, win, ns_id, mark_id, row, col] ~ Updates the position of an extmark which is currently visible in a -- cgit From 1de82e16c1216e1dbe22cf7a8ec9ea9e9e69b631 Mon Sep 17 00:00:00 2001 From: fredizzimo Date: Wed, 5 Jul 2023 16:31:34 +0300 Subject: fix(ui): delay win_viewport until screen update #24182 Problem: Sometimes, when nvim sends the `win_viewport` event, for example when scrolling with visible folds on the screen, it reports the `scroll_delta` value one batch into "future". So when the client application is trying to show the new viewport it's not yet updated, resulting in temporary corruption / screen flickering. For more details see #23609, and starting from [this comment]( https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in https://github.com/neovide/neovide/pull/1790,, where the issue was first detected. Note that some of the conclusions in those are not fully accurate, but the general observations are. Solution: When there are pending updates to a Window, delay the `win_viewport` UI event until the updates are sent. This ensures that there's no flush between sending the viewport and updating of the lines corresponding to the new viewport. Document the existing viewport behaviour (for cases where there are no extra flushes), give a hint about how applications can deal with the slightly surprising behaviour of the viewport event being sent after the updates. Fixes https://github.com/neovim/neovim/issues/23609 --- runtime/doc/ui.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index ead5e31e32..ec1d43d878 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -643,6 +643,13 @@ tabs. 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. -- cgit From aaa151d506dffa01506619fbdf57537cd2318675 Mon Sep 17 00:00:00 2001 From: ii14 <59243201+ii14@users.noreply.github.com> Date: Tue, 25 Jul 2023 14:07:13 +0200 Subject: docs: remove trailing spaces #24455 --- runtime/doc/ui.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index ec1d43d878..8784a395f2 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -434,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 @@ -652,7 +652,7 @@ tabs. ["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* -- cgit From dacd34364ff3af98bc2d357c43e3ce06638e2ce9 Mon Sep 17 00:00:00 2001 From: Jaehoon Hwang Date: Mon, 9 Oct 2023 01:48:24 -0700 Subject: feat(ui-ext): make 'mousehide' into proper ui_option (#25532) --- runtime/doc/ui.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 8784a395f2..9cf0e59854 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -211,6 +211,7 @@ the editor. - 'guifontwide' - 'linespace' - 'mousefocus' + - 'mousehide' - 'mousemoveevent' - 'pumblend' - 'showtabline' -- cgit From 8d9789a0f3b748b75ac4ae1b8e43d27af40d49fe Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Tue, 7 Nov 2023 11:31:21 -0600 Subject: docs: deprecate the "term_background" UI field --- runtime/doc/ui.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'runtime/doc/ui.txt') diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt index 9cf0e59854..ab99b0446f 100644 --- a/runtime/doc/ui.txt +++ b/runtime/doc/ui.txt @@ -52,7 +52,6 @@ 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 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. -- cgit