nvim-treesitter-endwise icon indicating copy to clipboard operation
nvim-treesitter-endwise copied to clipboard

fix: support `Query:iter_matches` changes in upstream neovim

Open PriceHiller opened this issue 1 year ago • 2 comments

Copied from the body of the commit:

Neovim's Query:iter_matches function now returns a list of Nodes for each match in nightly. Previously the iter_matches function only returned the last node. To get that previous behavior we just pull the last node out of the returned list of nodes.

According to :h news.txt, Query:iter_matches added a backwards compatibility option (all=false), but the intent is to remove it in a future release — thus it's better to rip the band-aid off now instead of fighting this again later on.

See https://github.com/neovim/neovim/commit/6913c5e1d975a11262d08b3339d50b579e6b6bb8.

TL;DR:

Neovim upstream recently changed the return from Query:iter_matches and this adds a simple shim to support it for current nightly users. It should have the exact same behavior as what was previously used AFAIK.

PriceHiller avatar Sep 03 '24 16:09 PriceHiller

@simonmandlik - Can this be merged?

olimorris avatar Sep 12 '24 17:09 olimorris

This is not a question for me — I didn't write a single line of code of the core of the plugin, only provided julia support :)

Perhaps @RRethy ?

simonmandlik avatar Sep 13 '24 09:09 simonmandlik