Skip to content

Commit 002b202

Browse files
authored
fix(telescope): handle hl_group ID correctly in picker (#1032)
## Description Since commit [742610e](742610e), extmark's hl_group can now be specified directly as an ID. This change ensures that if the hl_group is provided as a number (ID), it is resolved to its name using `synIDattr` for correct handling. Fixes: #1024
1 parent 5530d78 commit 002b202

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lua/telescope/_extensions/noice.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ function M.display(message)
2020
local byte = 0
2121
for _, text in ipairs(line._texts) do
2222
local hl_group = text.extmark and text.extmark.hl_group
23+
if type(hl_group) == "number" then
24+
hl_group = vim.fn.synIDattr(hl_group, "name")
25+
end
26+
2327
if hl_group then
2428
table.insert(hl, { { byte, byte + text:length() }, hl_group })
2529
end

0 commit comments

Comments
 (0)