mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #12858 from kyazdani42/fix/no-ts-hl-without-query-value
treesitter: check hl group exists before passing it in nvim_get_hl_id_by_name
This commit is contained in:
commit
c3e6b6119c
@ -98,7 +98,8 @@ function TSHighlighter:get_hl_from_capture(capture)
|
|||||||
return vim.split(name, '.', true)[1]
|
return vim.split(name, '.', true)[1]
|
||||||
else
|
else
|
||||||
-- Default to false to avoid recomputing
|
-- Default to false to avoid recomputing
|
||||||
return a.nvim_get_hl_id_by_name(TSHighlighter.hl_map[name])
|
local hl = TSHighlighter.hl_map[name]
|
||||||
|
return hl and a.nvim_get_hl_id_by_name(hl) or 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user