You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
telescope: require("telescope.health").check()
Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found fd 9.0.0
===== Installed extensions ===== ~
Telescope Extension: `file_browser` ~
- No healthcheck provided
Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured
Telescope Extension: `ui-select` ~
- No healthcheck provided
Steps to reproduce
download this directory of 2 3mb dummy json files(plus some empty files). Open Telescope find_files, move the selection up and down. Once you hit the unformatted file, Telescope will freeze for a few seconds, and even when you're no longer selecting that file, Telescope still lags.
Format the unformatted file, or duplicate the formatted file. Now we have roughly the same total amount of data, but this time Telescope is buttery smooth the whole way through. 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
vim.cmd[[set runtimepath=$VIMRUNTIME]]vim.cmd[[set packpath=/tmp/nvim/site]]localpackage_root='/tmp/nvim/site/pack'localinstall_path=package_root..'/packer/start/packer.nvim'localfunctionload_plugins()
require('packer').startup {
{
'wbthomason/packer.nvim',
{
'nvim-telescope/telescope.nvim',
requires= {
'nvim-lua/plenary.nvim',
{ 'nvim-telescope/telescope-fzf-native.nvim', run='make' },
},
},
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
},
config= {
package_root=package_root,
compile_path=install_path..'/plugin/packer_compiled.lua',
display= { non_interactive=true },
},
}
end_G.load_config=function()
require('telescope').setup()
require('telescope').load_extension('fzf')
-- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUEendifvim.fn.isdirectory(install_path) ==0thenprint("Installing Telescope and dependencies.")
vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
endload_plugins()
require('packer').sync()
vim.cmd[[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
The text was updated successfully, but these errors were encountered:
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 preview = { filesize_limit = <some value in MB> } } option to help with these larger files though. The filesize_limit check comes before the timeout check. Our default is 25MB.
Somehow, filesize_limit didn't work with a single large file 922 KB. I tried with { filesize_limit = 0.5555 } but telescope still froze ~30s and ignored preview timeout
If it's still not working for you, can you open another issue with more details?
I'm going to close this issue as I don't know if there's anything we can do about the original issue besides restricting the previewer via other means like I mentioned.
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: