mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #14767 from theHamsta/no-treesitter-mapping-to-non-existent
fix(treesitter): do not map hl_group when no mapping is set
This commit is contained in:
commit
faa3007927
@ -22,8 +22,6 @@ local _link_default_highlight_once = function(from, to)
|
|||||||
return from
|
return from
|
||||||
end
|
end
|
||||||
|
|
||||||
-- These are conventions defined by nvim-treesitter, though it
|
|
||||||
-- needs to be user extensible also.
|
|
||||||
TSHighlighter.hl_map = {
|
TSHighlighter.hl_map = {
|
||||||
["error"] = "Error",
|
["error"] = "Error",
|
||||||
|
|
||||||
@ -116,7 +114,7 @@ function TSHighlighterQuery:_get_hl_from_capture(capture)
|
|||||||
-- From "Normal.left" only keep "Normal"
|
-- From "Normal.left" only keep "Normal"
|
||||||
return vim.split(name, '.', true)[1], true
|
return vim.split(name, '.', true)[1], true
|
||||||
else
|
else
|
||||||
return TSHighlighter.hl_map[name] or name, false
|
return TSHighlighter.hl_map[name] or 0, false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user