feat(extmark): stack multiple highlight groups in hl_group

This has been possible in the "backend" for a while but
API was missing.

Followup: we will need a `details2=true` mode for `nvim_get_hl_id_by_name`
to return information in a way forward compatible with even further
enhancements.
This commit is contained in:
bfredl
2025-01-17 13:44:07 +01:00
parent 5dd60e01ac
commit 4cced601c8
7 changed files with 97 additions and 4 deletions

View File

@@ -2660,6 +2660,8 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts})
and below highlight groups can be supplied either as a
string or as an integer, the latter of which can be
obtained using |nvim_get_hl_id_by_name()|.
Multiple highlight groups can be stacked by passing an
array (highest priority last).
• hl_eol : when true, for a multiline highlight covering the
EOL of a line, continue the highlight for the rest of the
screen line (just like for diff and cursorline highlight).

View File

@@ -188,6 +188,7 @@ API
• |nvim_echo()| `err` field to print error messages and `chunks` accepts
highlight group IDs.
• |nvim_open_win()| `relative` field can be set to "laststatus" and "tabline".
• |nvim_buf_set_extmark()| `hl_group` field can be an array of layered groups
DEFAULTS

View File

@@ -595,6 +595,9 @@ function vim.api.nvim_buf_line_count(buffer) end
--- - hl_group : highlight group used for the text range. This and below
--- highlight groups can be supplied either as a string or as an integer,
--- the latter of which can be obtained using `nvim_get_hl_id_by_name()`.
---
--- Multiple highlight groups can be stacked by passing an array (highest
--- priority last).
--- - hl_eol : when true, for a multiline highlight covering the
--- EOL of a line, continue the highlight for the rest
--- of the screen line (just like for diff and

View File

@@ -241,7 +241,7 @@ error('Cannot require a meta file')
--- @field end_line? integer
--- @field end_row? integer
--- @field end_col? integer
--- @field hl_group? integer|string
--- @field hl_group? any
--- @field virt_text? any[]
--- @field virt_text_pos? string
--- @field virt_text_win_col? integer