Skip to content

Commit

Permalink
Fix a bug causing to not highlight a scope starting in the first line
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAbdi authored and theHamsta committed May 13, 2022
1 parent 75f5895 commit 5faadd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/nvim-treesitter-refactor/highlight_current_scope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function M.highlight_current_scope(bufnr)
local current_scope = locals.containing_scope(node_at_point, bufnr)

if current_scope then
local start_line = current_scope:start()
local start_line, _, end_line, _ = current_scope:range()

if start_line ~= 0 then
if start_line ~= 0 or end_line ~= vim.fn.line("$") then
ts_utils.highlight_node(current_scope, bufnr, current_scope_namespace, "TSCurrentScope")
end
end
Expand Down

0 comments on commit 5faadd9

Please sign in to comment.