From 5a721fef5620eb2fae6d9cebe09bf7b230f2606f Mon Sep 17 00:00:00 2001 From: partizan Date: Thu, 26 Aug 2021 23:39:10 +0300 Subject: [PATCH] fix: is_in_node_range now includes end line and col This fixes no indents at the end of python files Refs #1136 --- lua/nvim-treesitter/ts_utils.lua | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua index 72a74edcc..41197b792 100644 --- a/lua/nvim-treesitter/ts_utils.lua +++ b/lua/nvim-treesitter/ts_utils.lua @@ -227,19 +227,7 @@ end -- @param col A column (0-based) function M.is_in_node_range(node, line, col) local start_line, start_col, end_line, end_col = node:range() - if line >= start_line and line <= end_line then - if line == start_line and line == end_line then - return col >= start_col and col < end_col - elseif line == start_line then - return col >= start_col - elseif line == end_line then - return col < end_col - else - return true - end - else - return false - end + return line >= start_line and line <= end_line and col >= start_col and col <= end_col end function M.get_node_range(node_or_range)