aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/screen.lua
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-03-08 14:44:58 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2024-11-09 14:28:17 +0100
commit4f9260d06a48216862ebb34fc33744486b058f58 (patch)
treef69ecc9f6556e504af0f0b4aa04a72380f866162 /test/functional/ui/screen.lua
parent5cfa7a72f8c40cdcc0fa93693689915e913806f1 (diff)
downloadrneovim-4f9260d06a48216862ebb34fc33744486b058f58.tar.gz
rneovim-4f9260d06a48216862ebb34fc33744486b058f58.tar.bz2
rneovim-4f9260d06a48216862ebb34fc33744486b058f58.zip
feat(ext_messages): add hl_id to ext_messages chunks
Problem: Ext_messages chunks only contain the highlight attr id, which is not very useful for vim.ui_attach() consumers. Solotion: Add highlight group id to message chunks, which can easily be used to highlight text in the TUI through nvim_buf_set_extmark(): hl_group = synIDattr(id, "name").
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r--test/functional/ui/screen.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index f1891b608e..358e54dc55 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -1524,7 +1524,7 @@ end
function Screen:_chunks_repr(chunks, attr_state)
local repr_chunks = {}
for i, chunk in ipairs(chunks) do
- local hl, text = unpack(chunk)
+ local hl, text, id = unpack(chunk)
local attrs
if self._options.ext_linegrid then
attrs = self._attr_table[hl][1]
@@ -1532,7 +1532,7 @@ function Screen:_chunks_repr(chunks, attr_state)
attrs = hl
end
local attr_id = self:_get_attr_id(attr_state, attrs, hl)
- repr_chunks[i] = { text, attr_id }
+ repr_chunks[i] = { text, attr_id, attr_id and id or nil }
end
return repr_chunks
end