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:
Thomas Vigouroux 2021-08-07 11:44:41 +02:00 committed by GitHub
commit faa3007927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,8 +22,6 @@ local _link_default_highlight_once = function(from, to)
return from
end
-- These are conventions defined by nvim-treesitter, though it
-- needs to be user extensible also.
TSHighlighter.hl_map = {
["error"] = "Error",
@ -116,7 +114,7 @@ function TSHighlighterQuery:_get_hl_from_capture(capture)
-- From "Normal.left" only keep "Normal"
return vim.split(name, '.', true)[1], true
else
return TSHighlighter.hl_map[name] or name, false
return TSHighlighter.hl_map[name] or 0, false
end
end