mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 14:55:33 +00: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:
@@ -98,7 +98,8 @@ function TSHighlighter:get_hl_from_capture(capture)
|
||||
return vim.split(name, '.', true)[1]
|
||||
else
|
||||
-- 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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user