hrsh7th / cmp-path

nvim-cmp source for path
MIT License
627 stars 60 forks source link

neovim will block/freeze when retrieving lots of candidates #55

Closed FelipeLema closed 1 year ago

FelipeLema commented 2 years ago

hey, everyone

this is about the only problem I've encountered with this plugin. I take my hat off and congratulate the maintainers on some real robust code you have here.

So I have a single directory with about 1500 files and the whole neovim will freeze and not accept any inputs until all candidates have been fetched. It takes a few seconds to regain control of neovim.

My advice is replacing the while true block that does fs_scandir_next() and instead execute it in a separate thread using something like luv's thread pool work scheduling, probable with some sort of short-circuiting feature.

I can do a PR for this if the maintainers accept that this is within the scope of this package/plugin

FelipeLema commented 1 year ago

I forked this repo to fix this issue, see https://github.com/FelipeLema/cmp-async-path

zefr0x commented 10 months ago

@FelipeLema please open a PR so @hrsh7th can merge if it LGTH.