fzy-lua-native icon indicating copy to clipboard operation
fzy-lua-native copied to clipboard

Recent change seems to break wilder.nvim

Open farzadmf opened this issue 1 year ago • 5 comments

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

farzadmf avatar Apr 01 '23 13:04 farzadmf

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.

romgrk avatar Apr 01 '23 14:04 romgrk

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

CharlesChiuGit avatar Apr 02 '23 08:04 CharlesChiuGit

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

romgrk avatar Apr 02 '23 10:04 romgrk

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 avatar Apr 02 '23 13:04 farzadmf

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

farzadmf avatar Apr 03 '23 02:04 farzadmf