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 #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PriceHiller
Copy link

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.
@olimorris
Copy link

@simonmandlik - Can this be merged?

@simonmandlik
Copy link
Contributor

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 ?

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.

3 participants