Skip to content

Commit

Permalink
fix(highlight): don't apply usage highlight to definition node (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Collings <[email protected]>
  • Loading branch information
Amleto and Tom Collings authored Sep 14, 2024
1 parent 65ad2ec commit d8b74fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/nvim-treesitter-refactor/highlight_definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function M.highlight_usages(bufnr)
local usages = locals.find_usages(def_node, scope, bufnr)

for _, usage_node in ipairs(usages) do
if usage_node ~= node_at_point then
if usage_node ~= node_at_point and usage_node ~= def_node then
ts_utils.highlight_node(usage_node, bufnr, usage_namespace, "TSDefinitionUsage")
end
end
Expand Down

0 comments on commit d8b74fa

Please sign in to comment.