diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2024-09-01 13:01:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-01 18:01:53 +0000 |
commit | 6913c5e1d975a11262d08b3339d50b579e6b6bb8 (patch) | |
tree | e69809ec7eb0c7cb14b505eaf56f9de19b02a349 /runtime/lua/vim/treesitter/languagetree.lua | |
parent | 318c0415d5b10b44fee4afa06994734f1beb7e71 (diff) | |
download | rneovim-6913c5e1d975a11262d08b3339d50b579e6b6bb8.tar.gz rneovim-6913c5e1d975a11262d08b3339d50b579e6b6bb8.tar.bz2 rneovim-6913c5e1d975a11262d08b3339d50b579e6b6bb8.zip |
feat(treesitter)!: default to correct behavior for quantified captures (#30193)
For context, see https://github.com/neovim/neovim/pull/24738. Before
that PR, Nvim did not correctly handle captures with quantifiers. That
PR made the correct behavior opt-in to minimize breaking changes, with
the intention that the correct behavior would eventually become the
default. Users can still opt-in to the old (incorrect) behavior for now,
but this option will eventually be removed completely.
BREAKING CHANGE: Any plugin which uses `Query:iter_matches()` must
update their call sites to expect an array of nodes in the `match`
table, rather than a single node.
Diffstat (limited to 'runtime/lua/vim/treesitter/languagetree.lua')
-rw-r--r-- | runtime/lua/vim/treesitter/languagetree.lua | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua index d43a0a5d0b..cc9ffeaa29 100644 --- a/runtime/lua/vim/treesitter/languagetree.lua +++ b/runtime/lua/vim/treesitter/languagetree.lua @@ -833,13 +833,7 @@ function LanguageTree:_get_injections() local start_line, _, end_line, _ = root_node:range() for pattern, match, metadata in - self._injection_query:iter_matches( - root_node, - self._source, - start_line, - end_line + 1, - { all = true } - ) + self._injection_query:iter_matches(root_node, self._source, start_line, end_line + 1) do local lang, combined, ranges = self:_get_injection(match, metadata) if lang then |