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)