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

Bug: fzf crawls to a halt when scrolling through the preview on file search #1568

Closed
2 of 6 tasks
srodrigo opened this issue Dec 14, 2024 · 10 comments
Closed
2 of 6 tasks
Labels
bug Something isn't working

Comments

@srodrigo
Copy link

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

Linux

Shell

zsh

Neovim version (nvim --version)

NVIM v0.10.2

Fzf version (fzf --version)

N/A installed today with ./install --bin as per README

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

nil

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

require('fzf-lua').setup {
        winopts = {
          height = 0.95,
          width = 0.95,
        },
      }

Describe the bug / steps to reproduce

I couldn't record too much to avoid the size limit, but, as seen on the video, if I scroll through the preview, it gets slower and slower until it just freezes. Then it continues after a few seconds but very laggy and slow. I'm trying to scroll during all the video, even when it shows the scroll has stopped and then continues.

  1. Preview a file that makes the preview window scroll.
  2. Scroll up and down for a few seconds. It starts crawling until it halts.
Screencast.From.2024-12-14.16-24-09.mp4
@srodrigo srodrigo added the bug Something isn't working label Dec 14, 2024
@ibhagwan
Copy link
Owner

ibhagwan commented Dec 14, 2024

Probably related to treesitter, might be related to the beta of #1552.

  • Do you have nvim-treesitter-context installed?
  • Does this happen on all filetypes or just some (.cs as demonstrated)?
  • Can you try the below and lmk which of these solves the issue?
:FzfLua buffers  previewer.treesitter.context=false
:FzfLua buffers  previewer.treesitter.enable=false
:FzfLua buffers  previewer.syntax=false

@srodrigo
Copy link
Author

srodrigo commented Dec 14, 2024

Thanks for having a look :)

Probably related to treesitter, might be related to the beta of #1552.

  • Do you have nvim-treesitter-context installed?

Nope.

  • Does this happen on all filetypes or just some (.cs as demonstrated)?

I also tried with .tsx files, as C# files make my NeoVim a bit slow. But I have the same behaviour.

I just tried .md and plain text files, and I get the same behaviour even on short files where the preview doesn't need much scrolling.

  • Can you try the below and lmk which of these solves the issue?
:FzfLua buffers  previewer.treesitter.context=false

I get the same issue on a plain text file (131 lines).

:FzfLua buffers previewer.treesitter.enable=false

I get the same issue on the same plain text file.

:FzfLua buffers previewer.syntax=false

I get the same issue on the same plain text file.

@srodrigo
Copy link
Author

One thing I've noticed is that I can reproduce the issue very quickly if I just hold <S-down>. It takes a longer time to reproduce if I press and release quickly.

@ibhagwan
Copy link
Owner

One thing I've noticed is that I can reproduce the issue very quickly if I just hold <S-down>. It takes a longer time to reproduce if I press and release quickly.

Perhaps some auto command in your config is causing this? Can you try with mini.sh?

@srodrigo
Copy link
Author

One thing I've noticed is that I can reproduce the issue very quickly if I just hold <S-down>. It takes a longer time to reproduce if I press and release quickly.

Perhaps some auto command in your config is causing this? Can you try with mini.sh?

Good call. I've just tried mini.sh and I get the exact same behaviour.

@ibhagwan
Copy link
Owner

ibhagwan commented Dec 14, 2024

I can't seem to reproruce this, can you try 1568 branch and let me know if this feels better and if you see fzf-lua messages saying skip page-down (or up) in :messages?

Also can you try the below and lmk if any of these makes a difference?

:FzfLua buffers winopts.preview.scrollbar=border -- the default
:FzfLua buffers winopts.preview.scrollbar=float
:FzfLua buffers winopts.preview.scrollbar=false

@ibhagwan
Copy link
Owner

I have a feeling this is related to the preview scrollbar of type border and setting winopts.preview.scrollbar to false (disable) or float will work better, if you can confirm my suspecion the solution is near.

ibhagwan added a commit that referenced this issue Dec 15, 2024
Backward compat for `border` uses `float` code with a reversed bg|fg
`FzfLuaScrollBorderFull` highlight as `FzfLuaScrollBorderBackCompat`

Didn't make sense to keep the old code and was causing perf issues.

Closes #1568
@ibhagwan
Copy link
Owner

@srodrigo, I believe f07f0d3 is in high liklihood to solve this issue.

Kindly reopen the issue if I'm wrong or confirm it's solved?

@srodrigo
Copy link
Author

I can't seem to reproruce this, can you try 1568 branch and let me know if this feels better and if you see fzf-lua messages saying skip page-down (or up) in :messages?

Also can you try the below and lmk if any of these makes a difference?

:FzfLua buffers winopts.preview.scrollbar=border -- the default
:FzfLua buffers winopts.preview.scrollbar=float
:FzfLua buffers winopts.preview.scrollbar=false

Sorry, just logged in now.

@srodrigo, I believe f07f0d3 is in high liklihood to solve this issue.

This indeed solved the issue! It works with the default settings.

Thank you so much @ibhagwan :)

@ibhagwan
Copy link
Owner

This indeed solved the issue! It works with the default settings.

Ty for the confirmation, happy my hunch worked and that was the issue :-)

Was also a much needed change anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants