aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2025-01-16 18:10:22 +0100
committerluukvbaal <luukvbaal@gmail.com>2025-01-23 10:56:25 +0100
commit34d808b73cbcb0a43636d826282193ab1ca8c148 (patch)
tree1a03834e3651002e92bf3a4732b05c061aa97898 /runtime
parent8634bd46b26f28fa26950128b0cc585560bd6a9a (diff)
downloadrneovim-34d808b73cbcb0a43636d826282193ab1ca8c148.tar.gz
rneovim-34d808b73cbcb0a43636d826282193ab1ca8c148.tar.bz2
rneovim-34d808b73cbcb0a43636d826282193ab1ca8c148.zip
feat(api): combined highlights in nvim_eval_statusline()
Problem: Combined highlighting was not applied to nvim_eval_statusline(), and 'statuscolumn' sign segment/numhl highlights. Solution: Add an additional `groups` element to the return value of `nvim_eval_statusline()->highlights`. This is an array of stacked highlight groups (highest priority last). Also resolve combined highlights for the 'statuscolumn' sign segment/numhl highlights. Expose/synchronize some drawline.c logic that is now mimicked in three different places.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt5
-rw-r--r--runtime/doc/news.txt6
-rw-r--r--runtime/lua/vim/_meta/api.lua4
3 files changed, 11 insertions, 4 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index b452db9f3e..c5ade72f93 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -672,7 +672,10 @@ nvim_eval_statusline({str}, {opts}) *nvim_eval_statusline()*
true. Each element of the array is a |Dict| with these keys:
• start: (number) Byte index (0-based) of first character that uses
the highlight.
- • group: (string) Name of highlight group.
+ • group: (string) Name of highlight group. May be removed in the
+ future, use `groups` instead.
+ • groups: (array) Names of stacked highlight groups (highest
+ priority last).
nvim_exec_lua({code}, {args}) *nvim_exec_lua()*
Execute Lua code. Parameters (if any) are available as `...` inside the
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 0f1ec01d19..099fc17c5d 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -421,8 +421,10 @@ These existing features changed their behavior.
using the upgraded implementation.
• Custom highlights in 'rulerformat', 'statuscolumn', 'statusline', 'tabline',
- 'winbar' and the number column (through |:sign-define| `numhl`) now combine
- with their respective highlight groups, as opposed to |hl-Normal|.
+ 'winbar', and the sign/number column are stacked with their respective
+ highlight groups, as opposed to |hl-Normal|.
+ This is also reflected in the `highlights` from |nvim_eval_statusline()|,
+ with a new `groups` field containing an array of stacked highlight groups.
• |vim.on_key()| callbacks won't be invoked recursively when a callback itself
consumes input.
diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua
index 2f9ab5b846..6d9a17ea2b 100644
--- a/runtime/lua/vim/_meta/api.lua
+++ b/runtime/lua/vim/_meta/api.lua
@@ -1131,7 +1131,9 @@ function vim.api.nvim_eval(expr) end
--- the "highlights" key in {opts} is true. Each element of the array is a
--- |Dict| with these keys:
--- - start: (number) Byte index (0-based) of first character that uses the highlight.
---- - group: (string) Name of highlight group.
+--- - group: (string) Name of highlight group. May be removed in the future, use
+--- `groups` instead.
+--- - groups: (array) Names of stacked highlight groups (highest priority last).
function vim.api.nvim_eval_statusline(str, opts) end
--- @deprecated