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

Recent change seems to break wilder.nvim #24

Open
farzadmf opened this issue Apr 1, 2023 · 5 comments
Open

Recent change seems to break wilder.nvim #24

farzadmf opened this issue Apr 1, 2023 · 5 comments

Comments

@farzadmf
Copy link

farzadmf commented Apr 1, 2023

Hi, I'm using wilder.nvim, and it depends on this plugin for its fuzzy search.

After the recent change, I'm getting an error for this line saying that:

wilder.nvim/lua/wilder/internal.lua:7: invalid order function for sorting

I'd appreciate if you let me know if there's a fix for this

@romgrk
Copy link
Owner

romgrk commented Apr 1, 2023

My bad. I've reverted the changes for now.
I'll try to reproduce the bug locally. Any hints you can give me to debug this? Would you be able to show me the value of scores before and after tha change?

Thanks for the report.

@CharlesChiuGit
Copy link

i think maybe it should be wilder to update it code?

@romgrk
Copy link
Owner

romgrk commented Apr 2, 2023

This change is not supposed to be breaking, we're only moving files around in an API-compatible way.

@farzadmf
Copy link
Author

farzadmf commented Apr 2, 2023

Sorry for the late reply @romgrk , I got quite busy yesterday didn't get a chance to look into things.

we're only moving files around in an API-compatible way

I totally get what you mean, and, honestly, I was confused myself

Hopefully today, when I get a chance, I'll try to see what that scores variable is by resetting fzy-lua-native to different commits, and hopefully that would give a clue

@farzadmf
Copy link
Author

farzadmf commented Apr 3, 2023

Hey @romgrk , so I tried to see what the scores variable is, and, since wilder is depending on a[3] and b[3], as I suspected, the returned tables don't have that

I'm getting QUITE a few ones since I think wilder calls that function for every key press or something.

But, this is what I see with the refactored code:

{ { "!", {} }, { "#", {} }, { "&", {} }, ... }

And this is what I get with the old non-refactored code (or the reverted code):

{ { "!", {}, -inf }, { "#", {}, -inf }, { "&", {}, -inf }, ... }

Hopefully, this gives a clue. Let me know if you need any other information that can help

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

No branches or pull requests

3 participants