diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-07-25 10:16:33 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-08-17 16:20:39 +0200 |
commit | d879331b0dee66cb106b5bea9efc2f920caf9abd (patch) | |
tree | 05188f0b72e9aa7432f2f08516a6f239e491419f /runtime | |
parent | f7cfca49d6f1380b2ec0b0f7723ea308d0810857 (diff) | |
download | rneovim-d879331b0dee66cb106b5bea9efc2f920caf9abd.tar.gz rneovim-d879331b0dee66cb106b5bea9efc2f920caf9abd.tar.bz2 rneovim-d879331b0dee66cb106b5bea9efc2f920caf9abd.zip |
feat(ui): allow to set the highlight namespace per window
- reimplement 'winhl' in terms of highlight namespaces
- check for EOF in screen tests (to indicate a likely crash)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 43 | ||||
-rw-r--r-- | runtime/doc/options.txt | 10 |
2 files changed, 35 insertions, 18 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 12edaa1f08..a388592981 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -603,20 +603,6 @@ nvim__inspect_cell({grid}, {row}, {col}) *nvim__inspect_cell()* NB: if your UI doesn't use hlstate, this will not return hlstate first time. -nvim__set_hl_ns({ns_id}) *nvim__set_hl_ns()* - Set active namespace for highlights. - - NB: this function can be called from async contexts, but the semantics are - not yet well-defined. To start with |nvim_set_decoration_provider| on_win - and on_line callbacks are explicitly allowed to change the namespace - during a redraw cycle. - - Attributes: ~ - |api-fast| - - Parameters: ~ - {ns_id} the namespace to activate - nvim__stats() *nvim__stats()* Gets internal stats. @@ -1414,6 +1400,26 @@ nvim_set_hl({ns_id}, {name}, {*val}) *nvim_set_hl()* set, cterm attributes will match those from the attribute map documented above. +nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()* + Set active namespace for highlights. This can be set for a single window, + see |nvim_win_set_hl_ns|. + + Parameters: ~ + {ns_id} the namespace to use + +nvim_set_hl_ns_fast({ns_id}) *nvim_set_hl_ns_fast()* + Set active namespace for highlights while redrawing. + + This function meant to be called while redrawing, primarily from + |nvim_set_decoration_provider| on_win and on_line callbacks, which are + allowed to change the namespace during a redraw cycle. + + Attributes: ~ + |api-fast| + + Parameters: ~ + {ns_id} the namespace to activate + nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()* Sets a global |mapping| for the given mode. @@ -2875,6 +2881,15 @@ nvim_win_set_height({window}, {height}) *nvim_win_set_height()* {window} Window handle, or 0 for current window {height} Height as a count of rows +nvim_win_set_hl_ns({window}, {ns_id}) *nvim_win_set_hl_ns()* + Set highlight namespace for a window. This will use highlights defined in + this namespace, but fall back to global highlights (ns=0) when missing. + + This takes predecence over the 'winhighlight' option. + + Parameters: ~ + {ns_id} the namespace to use + nvim_win_set_var({window}, {name}, {value}) *nvim_win_set_var()* Sets a window-scoped (w:) variable diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 349c442c9f..a1f2eac5ed 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -7096,10 +7096,12 @@ A jump table for the options with a short description can be found at |Q_op|. 'winhighlight' 'winhl' string (default empty) local to window Window-local highlights. Comma-delimited list of highlight - |group-name| pairs "{hl-builtin}:{hl},..." where each {hl-builtin} is - a built-in |highlight-groups| item to be overridden by {hl} group in - the window. Only built-in |highlight-groups| are supported, not - syntax highlighting (use |:ownsyntax| for that). + |group-name| pairs "{hl-from}:{hl-to},..." where each {hl-from} is + a |highlight-groups| item to be overridden by {hl-to} group in + the window. + + Note: highlight namespaces take precedence over 'winhighlight'. + See |nvim_win_set_hl_ns| and |nvim_set_hl|. Highlights of vertical separators are determined by the window to the left of the separator. The 'tabline' highlight of a tabpage is |