diff options
| author | haoxian <haoxianhan@gmail.com> | 2023-02-02 12:06:34 +0800 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-02-11 15:37:53 -0800 |
| commit | dd600cf1c28aed1d922063c76b081c222d5b7fbc (patch) | |
| tree | 354f25d8068b573cc723081bb631dd99173a2218 /lua | |
| parent | Update parsers: haskell, jsonnet, tlaplus (diff) | |
| download | nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.tar nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.tar.gz nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.tar.bz2 nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.tar.lz nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.tar.xz nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.tar.zst nvim-treesitter-dd600cf1c28aed1d922063c76b081c222d5b7fbc.zip | |
fix: incremental_selection error
if some empty lines in the end of file,
would throw error messages when incremental_selection to the whole file.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/ts_utils.lua | 1 |
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 |
