ibhagwan / fzf-lua

Improved fzf.vim written in lua
MIT License
2.37k stars 151 forks source link

Bug: FzfLua files NOT show all the files in project #1521

Closed bo-wu closed 2 weeks ago

bo-wu commented 2 weeks ago

RTFM Checklist

Operating system

Windows

Shell

zsh 5.9

Neovim version (nvim --version)

NVIM v0.10.1

Fzf version (fzf --version)

0.56.0 (ff16877)

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

nil

Is the problem reproducible with mini.sh?

Fzf-lua configuration

{
"ibhagwan/fzf-lua",
opts = {
  defaults = {
    formatter = "path.filename_first",
    path_shorten = 3,
    fzf_opts = {
      ["--cycle"] = true,
    },
  },
},
}

Describe the bug / steps to reproduce

  1. install neovim, zsh, fzf, fd, rg
  2. install LazyVim and use its default config
  3. use command LazyExtras to change default option from telescope to fzf-lua ( editor.fzf)
  4. open project (depth of folder is more than 3) with more than 400 files.

fd --version 9.0.0 rg --version 14.1.0 (rev e50df40a19) image

ibhagwan commented 2 weeks ago

Windows zsh

How is that possible? Are you using WSL2?

bo-wu commented 2 weeks ago

Windows zsh

How is that possible? Are you using WSL2?

I use Msys2 image

ibhagwan commented 2 weeks ago

I use Msys2

I have a feeling the issue is related to this.

bo-wu commented 2 weeks ago

I use Msys2

I have a feeling the issue is related to this.

Maybe. I just check a ubuntu server, with similar config, it shows all the files and with file icons.

ibhagwan commented 2 weeks ago

Can you try removing the below from your config?

  formatter = "path.filename_first",
  path_shorten = 3,
bo-wu commented 2 weeks ago

Can you try removing the below from your config?

  formatter = "path.filename_first",
  path_shorten = 3,

I tried. But still only show part of files. Must set file_icons = false to show all the files.

ibhagwan commented 2 weeks ago

Can you try removing the below from your config?

  formatter = "path.filename_first",
  path_shorten = 3,

I tried. But still only show part of files. Must set file_icons = false to show all the files.

Since it would take me a while to get my hands again on a Windows machine and since you mentioned https://github.com/ibhagwan/fzf-lua/discussions/1519#discussioncomment-11205036 it works with mini.sh it would be very helpful if you can find out which option / plugin / autocmd in your config is the trigger for this issue.

Although this seems like a not very common issue I’d still like to fix it on fzf-luau’s side as well.

bo-wu commented 2 weeks ago

Can you try removing the below from your config?

  formatter = "path.filename_first",
  path_shorten = 3,

I tried. But still only show part of files. Must set file_icons = false to show all the files.

Since it would take me a while to get my hands again on a Windows machine and since you mentioned #1519 (reply in thread) it works with mini.sh it would be very helpful if you can find out which option / plugin / autocmd in your config is the trigger for this issue.

Although this seems like a not very common issue I’d still like to fix it on fzf-luau’s side as well.

Since I am not familiar with Lua, would you please show me some clues or tutorial about what I should try and how to do that?

ibhagwan commented 2 weeks ago

Since it would take me a while to get my hands again on a Windows machine and since you mentioned #1519 (reply in thread) it works with mini.sh it would be very helpful if you can find out which option / plugin / autocmd in your config is the trigger for this issue. Although this seems like a not very common issue I’d still like to fix it on fzf-luau’s side as well.

Since I am not familiar with Lua, would you please show me some clues or tutorial about what I should try and how to do that?

That would be a bit hard to explain as this is not just lua but also neovim config, how it works, etc, if I recall you’re using LazyVim which comes preloaded with a lot of configuration / plugins…

Btw, I just installed MSYS2 on my Win VM, perhaps you can save me some time, how do I install neovim/fzf/fd/ripgrep on MSYS2? It seems the default pacman repos don’t have any of these?

bo-wu commented 2 weeks ago

Since it would take me a while to get my hands again on a Windows machine and since you mentioned #1519 (reply in thread) it works with mini.sh it would be very helpful if you can find out which option / plugin / autocmd in your config is the trigger for this issue. Although this seems like a not very common issue I’d still like to fix it on fzf-luau’s side as well.

Since I am not familiar with Lua, would you please show me some clues or tutorial about what I should try and how to do that?

That would be a bit hard to explain as this is not just lua but also neovim config, how it works, etc, if I recall you’re using LazyVim which comes preloaded with a lot of configuration / plugins…

Btw, I just installed MSYS2 on my Win VM, perhaps you can save me some time, how do I install neovim/fzf/fd/ripgrep on MSYS2? It seems the default pacman repos don’t have any of these?

Just download each released binary file from github release page. Double click to install neovim, and the others just put them in any location that included in the PATH environment settings.

BTW, usually I don't use Windows for my own. As in the company, I have no choice. (=

ibhagwan commented 2 weeks ago

Just download each released binary file from github release page. Double click to install neovim, and the others just put them in any location that included in the PATH environment settings.

I see, so basically just the .exe versions of these, not a special MSYS2 binary.

bo-wu commented 2 weeks ago

I see, so basically just the .exe versions of these, not a special MSYS2 binary.

Yes. That's right.

ibhagwan commented 2 weeks ago

Using MSYS2 with my config and neovim nightly (which I had installed already via scoop.sh) and the project you linked in https://github.com/ibhagwan/fzf-lua/discussions/1519#discussioncomment-11209227, I get the same number of files (906).

https://github.com/SFML/SFML.git

Fzf-lua with icons (ignore the empty icons as I didn't install a nerd font) - 906 files image

Telescope - 906 files image

bo-wu commented 2 weeks ago

How do you enable fzf-lua? Do you use LazyExtras to enable fzf-lua?

You don't have any other config by yourself?

I will try to remove all other configs by myself, and to see if any one will cause the problem.

ibhagwan commented 2 weeks ago

How do you enable fzf-lua? Do you use LazyExtras to enable fzf-lua?

You don't have any other config by yourself?

I will try to remove all other configs by myself, and to see if any one will cause the problem.

LazyVim is a distribution, it configures nvim for you, my config was made by myself, you can find it here: https://github.com/ibhagwan/nvim-lua

bo-wu commented 2 weeks ago

How do you enable fzf-lua? Do you use LazyExtras to enable fzf-lua? You don't have any other config by yourself? I will try to remove all other configs by myself, and to see if any one will cause the problem.

LazyVim is a distribution, it configures nvim for you, my config was made by myself, you can find it here: https://github.com/ibhagwan/nvim-lua

I mean the personal config based on LazyVim. And Just now I tried removing all my other plugin configs, it still shows part of files. Is it related to the terminal? I use the Windows Terminal. (I just realized that it has nothing do with MSYS2, since I download each exe files by myself. Sorry for misleading)

BTW, I enable fzf-lua inside LazyVim by command LazyExtras, and use x key to enable fzf-lua plugin

ibhagwan commented 2 weeks ago

I mean the personal config based on LazyVim. And Just now I tried removing all my other plugin configs, it still shows part of files.

Maybe it's one of the options set by LazyVim not necessarily a plugin, might also be an autocmd, I really can't tell.

Is it related to the terminal? I use the Windows Terminal.

I don't think terminal has anything to do with it.

BTW, I enable fzf-lua inside LazyVim by command LazyExtras, and use x key to enable fzf-lua plugin

As I mentioned LazyVim is a distribution, the UI to enable disable plugins is part of LazyVim, it's far from a minimal neovim install (as with mini.sh), LazyVim adds a lot of code, unfortuntaely there's no way around it to debug, you'll need to learn how to configure neovim by yourself as well as lua in order to understand how LazyVim works.

You can also try my config that I linked, it will also install all plugins for you, once installed you can run fzf-lua with <space><c-p> or Telescope with <c-p> and see if there's a difference.

bo-wu commented 2 weeks ago

I mean the personal config based on LazyVim. And Just now I tried removing all my other plugin configs, it still shows part of files.

Maybe it's one of the options set by LazyVim not necessarily a plugin, might also be an autocmd, I really can't tell.

Is it related to the terminal? I use the Windows Terminal.

I don't think terminal has anything to do with it.

BTW, I enable fzf-lua inside LazyVim by command LazyExtras, and use x key to enable fzf-lua plugin

As I mentioned LazyVim is a distribution, the UI to enable disable plugins is part of LazyVim, it's far from a minimal neovim install (as with mini.sh), LazyVim adds a lot of code, unfortuntaely there's no way around it to debug, you'll need to learn how to configure neovim by yourself as well as lua in order to understand how LazyVim works.

You can also try my config that I linked, it will also install all plugins for you, once installed you can run fzf-lua with <space><c-p> or Telescope with <c-p> and see if there's a difference.

OK. I understand that the root cause is probably the config that conflicts. Thanks a lot. I will try your config.

ibhagwan commented 2 weeks ago

OK. I understand that the root cause is probably the config that conflicts. Thanks a lot. I will try your config.

Let's keep this open until this is resolved, I will investigate more, no matter the conflicts fzf-lua shouldn't crash

ibhagwan commented 2 weeks ago

@bo-wu, I believe I 've solved this issue with https://github.com/ibhagwan/fzf-lua/commit/6fbf7a9ee29e1e3e4cfd1af5c6406042e776883d.

Will you be able to update your fzf-lua to the latest commit and try again?

bo-wu commented 2 weeks ago

@bo-wu, I believe I 've solved this issue with 6fbf7a9.

Will you be able to update your fzf-lua to the latest commit and try again?

Yes! Now it shows all the files. Thank you very much!

ibhagwan commented 2 weeks ago

@bo-wu, I believe I 've solved this issue with 6fbf7a9. Will you be able to update your fzf-lua to the latest commit and try again?

Yes! Now it shows all the files. Thank you very much!

Fantastic! Ty for the confirmation and help debugging this.

noahlias commented 2 weeks ago

@ibhagwan

Sorry, there seems to be some bug in this new version update on macOS, I reverted it to the last commit, and it works. It could be handled with a different os.

I just use quick move on the fzf result, and it comes to this error image

ibhagwan commented 2 weeks ago

Ty for letting me know @noahlias, can you try the latest commit https://github.com/ibhagwan/fzf-lua/commit/8af7f00a11fbeb33a88cf95c951460eb8b1fb531?

noahlias commented 2 weeks ago

Ty for letting me know @noahlias, can you try the latest commit 8af7f00?

OK, it works.