aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorThomas Vigouroux <tomvig38@gmail.com>2020-06-07 16:37:11 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-06-29 22:21:06 +0200
commit333f3f19db612acc893791f04624da174efe04b5 (patch)
tree70635122db7bf8601248b87348d720c6a0b8b474 /runtime/lua/vim
parent36d71e775a44526abd70b2720a589a1113c650d7 (diff)
downloadrneovim-333f3f19db612acc893791f04624da174efe04b5.tar.gz
rneovim-333f3f19db612acc893791f04624da174efe04b5.tar.bz2
rneovim-333f3f19db612acc893791f04624da174efe04b5.zip
treesitter: add set_included_ranges to the parser
This is the first step towards language injection using treesitter.
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/treesitter.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index c502e45bd0..d5bc8e0a1b 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -30,6 +30,12 @@ function Parser:_on_lines(bufnr, _, start_row, old_stop_row, stop_row, old_byte_
self.valid = false
end
+function Parser:set_included_ranges(ranges)
+ self._parser:set_included_ranges(self.bufnr, ranges)
+ -- The buffer will need to be parsed again later
+ self.valid = false
+end
+
local M = {
parse_query = vim._ts_parse_query,
}