aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/ts_utils.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/ts_utils.lua b/lua/nvim-treesitter/ts_utils.lua
index e9fdc41d2..775094bd5 100644
--- a/lua/nvim-treesitter/ts_utils.lua
+++ b/lua/nvim-treesitter/ts_utils.lua
@@ -246,6 +246,7 @@ function M.get_vim_range(range, buf)
else
ecol = #api.nvim_buf_get_lines(buf, erow - 1, erow, false)[1]
end
+ ecol = math.max(ecol, 1)
end
return srow, scol, erow, ecol
end