diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-06-14 18:50:22 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-06-29 22:21:06 +0200 |
commit | ac18403d6e58a08956f9465998f2223df4e19108 (patch) | |
tree | 8ffd5c48a1da8bf005b2575710c078a03758a13f /src/nvim | |
parent | 333f3f19db612acc893791f04624da174efe04b5 (diff) | |
download | rneovim-ac18403d6e58a08956f9465998f2223df4e19108.tar.gz rneovim-ac18403d6e58a08956f9465998f2223df4e19108.tar.bz2 rneovim-ac18403d6e58a08956f9465998f2223df4e19108.zip |
treesitter: test newly added set_included_ranges
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/lua/treesitter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/lua/treesitter.c b/src/nvim/lua/treesitter.c index 9e3bbb38fc..6176a1b7c3 100644 --- a/src/nvim/lua/treesitter.c +++ b/src/nvim/lua/treesitter.c @@ -447,8 +447,9 @@ static int parser_set_ranges(lua_State *L) { } // TODO: For sure that's wrong, try to find a way to get the byte offset directly - uint32_t start_byte = ml_find_line_or_offset(buf, start_row, NULL, false) + start_col; - uint32_t stop_byte = ml_find_line_or_offset(buf, stop_row, NULL, false) + stop_col; + // Lines are 0 based for consistency + uint32_t start_byte = ml_find_line_or_offset(buf, start_row + 1, NULL, false) + start_col; + uint32_t stop_byte = ml_find_line_or_offset(buf, stop_row + 1, NULL, false) + stop_col; ranges[index] = (TSRange) { .start_point = (TSPoint) { |