fix: update tree-sitter mappings (#92)

master
Stephan Seitz 2 years ago committed by GitHub
parent 90d2b3e172
commit 49e5dd2b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,12 +14,6 @@ function M.get_treesitter_hl()
local highlights = {}
for _, hl in pairs(results) do
local line = "* **@" .. hl.capture .. "**"
if hl.specific then
line = line .. " -> **" .. hl.specific .. "**"
end
if hl.general then
line = line .. " -> **" .. hl.general .. "**"
end
if hl.priority then
line = line .. "(" .. hl.priority .. ")"
end

@ -65,12 +65,7 @@ function M.get_hl_groups_at_position(bufnr, row, col)
if hl and ts_utils.is_in_node_range(node, row, col) then
local c = query._query.captures[capture] -- name of the capture in the query
if c ~= nil then
local general_hl, is_vim_hl = c, false
local local_hl = not is_vim_hl and (tree:lang() .. general_hl)
table.insert(
matches,
{ capture = c, specific = local_hl, general = general_hl, priority = metadata.priority }
)
table.insert(matches, { capture = c, priority = metadata.priority })
end
end
end

Loading…
Cancel
Save