Skip to content

Commit

Permalink
skip spell and nospell highlight captures
Browse files Browse the repository at this point in the history
  • Loading branch information
lyokha committed May 24, 2024
1 parent ed54670 commit 40dc708
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/publish-helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ function M.get_node_hl(bufnr, row, col)

for capture, node, _, _ in iter do
if ts.is_in_node_range(node, row0, col0) then
local name = query._query.captures[capture]
if name == 'spell' or name == 'nospell' then
goto skip
end
hlid = vim.fn.has('nvim-0.10') == 1
and query:get_hl_from_capture(capture)
or query.hl_cache[capture]
if hlid ~= 0 then
local _, _, end_row, end_col = ts.get_node_range(node)
len = end_row > row0 and 0 or end_col - col0
end
end
end ::skip::
end
end)
end
Expand Down

0 comments on commit 40dc708

Please sign in to comment.