-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
Freezes on single line files, ignoring preview timeout #3032
Comments
Hey, yeah so unfortunately, I don't think there's a great way to do true timeouts in Lua as we don't have preemptive multithreading. Our current implementation of the timeout is based on time between iterations of line splitting. So in cases like yours, where you have a large file with few lines, you can exceed the timeout period potentially significantly. You can use the |
Description
If I'm searching for a file, my Telescope will frequently lock up. I have quite a number of 5-20MB JSON files in the project. If the search query ever causes one of these files to be the top sorted result, my nvim would freeze for about 10-20 seconds. I tried adding preview timeout, no luck. I've just made the connection that it's specifically on single line files that it locks up. If I format the file that was giving me issues, then trying the same keystrokes again in Telescope find_files will correctly trigger the "previewer timed out". But for unformatted, single-line files, it freezes the whole nvim considerably.
Neovim version
Operating system and version
macOS 14.0
Telescope version / branch / rev
latest
checkhealth telescope
Steps to reproduce
telescope_bug.zip
In this demo the delay is shorter as I didn't think you'd want some huge files, so these are only 3MB, but it should be enough to demonstrate the issue. When the files get up above 10-20MB, it's unresponsive for a good 10+ seconds.
Expected behavior
The previewer should timeout out without freezing nvim.
Actual behavior
The previewer takes a few seconds to timeout.
Minimal config
The text was updated successfully, but these errors were encountered: