From e72f8b7d0d03c34415d1a286a72ce7e2bc4b4442 Mon Sep 17 00:00:00 2001 From: JafarAbdi Date: Sat, 26 Mar 2022 06:15:41 +0300 Subject: [PATCH] Fix a bug causing to not highlight a scope starting in the first line --- lua/nvim-treesitter-refactor/highlight_current_scope.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/nvim-treesitter-refactor/highlight_current_scope.lua b/lua/nvim-treesitter-refactor/highlight_current_scope.lua index fc26187..aa3b4cb 100644 --- a/lua/nvim-treesitter-refactor/highlight_current_scope.lua +++ b/lua/nvim-treesitter-refactor/highlight_current_scope.lua @@ -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