Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support Query:iter_matches changes in upstream neovim #94

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

PriceHiller
Copy link
Contributor

@PriceHiller PriceHiller commented Sep 3, 2024

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 neovim/neovim@6913c5e.

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.

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 neovim/neovim@6913c5e.
@PriceHiller
Copy link
Contributor Author

I can't replicate the stylua failure locally 🤷

Copy link
Owner

@lukas-reineke lukas-reineke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is broken, this is fine
thanks

@lukas-reineke lukas-reineke merged commit c19bbff into lukas-reineke:master Sep 9, 2024
1 of 3 checks passed
@PriceHiller PriceHiller deleted the fix/quant-capture branch September 9, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants