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

previewers.file_maker freezes neovim when/while file read is slow #3389

Open
FelipeLema opened this issue Dec 17, 2024 · 2 comments
Open

previewers.file_maker freezes neovim when/while file read is slow #3389

FelipeLema opened this issue Dec 17, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@FelipeLema
Copy link

Description

let's say I have a slow-access mount at /home/myuser/slow-access-mnt. If I call :Telescope find_files and move the selection towards one of those files, neovim freezes until preview is ready or it times out.

the freezing comes from previewers.file_maker waiting on capture("file --mime-type -b …"), since it blocks waiting for that command's output. Replacing that call with an async call (probably using vim.uv) should avoid neovim freezing.

on the same matter, a "preview loading" message would be welcome as an UX plus

Neovim version

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

Operating system and version

debian 12

Telescope version / branch / rev

a0bbec2

checkhealth telescope

==============================================================================
telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fdfind 8.6.0

===== Installed extensions ===== ~

Telescope Extension: `frecency` ~
- OK nvim-web-devicons installed.
- OK ripgrep installed.

Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured

Steps to reproduce

  1. have a mount that have slow read (you can try using mkfifo /some/path to simulate a file with slow read)
  2. :Telescope find_files
  3. do stuff while preview is loading for that mount

Expected behavior

neovim is responsive while preview is loading

maybe show a "preview is loading" message

Actual behavior

check that stuff inputted in last step is not inputted right away, but rather queued until previewer is done

Minimal config

-- any recent Telescope version
@FelipeLema FelipeLema added the bug Something isn't working label Dec 17, 2024
@FelipeLema
Copy link
Author

willing to do a PR to fix it if maintainers are willing to accept

@FelipeLema
Copy link
Author

also willing to tidy up the whole filetype-mime-filesize-timeout-hook code if maintainers are willing to accept

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

1 participant