Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 5faadd9

Browse files
JafarAbditheHamsta
authored andcommitted
Fix a bug causing to not highlight a scope starting in the first line
1 parent 75f5895 commit 5faadd9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua/nvim-treesitter-refactor/highlight_current_scope.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ function M.highlight_current_scope(bufnr)
1616
local current_scope = locals.containing_scope(node_at_point, bufnr)
1717

1818
if current_scope then
19-
local start_line = current_scope:start()
19+
local start_line, _, end_line, _ = current_scope:range()
2020

21-
if start_line ~= 0 then
21+
if start_line ~= 0 or end_line ~= vim.fn.line("$") then
2222
ts_utils.highlight_node(current_scope, bufnr, current_scope_namespace, "TSCurrentScope")
2323
end
2424
end

0 commit comments

Comments
 (0)