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

The plugin can block Neovim for a long time #85

Open
gregorias opened this issue Mar 25, 2023 · 3 comments
Open

The plugin can block Neovim for a long time #85

gregorias opened this issue Mar 25, 2023 · 3 comments

Comments

@gregorias
Copy link

gregorias commented Mar 25, 2023

This plugin synchronously calls vim.fn.getcompletion. When that happens, the entire Neovim is blocked until that call completes. Unfortunately, that call can take a long time in some circumstances. For example, completing :e huge_nfs_directory/ takes a minute on my machine. I suspect that #84 is another example of this.

There are a few avenues we could take to remedy this:

@gregorias gregorias changed the title The plugin can hang for a long time The plugin can block Neovim for a long time Mar 25, 2023
@liquiddandruff
Copy link

liquiddandruff commented Apr 12, 2023

Hitting this too at the moment, made me think it was an issue with cmp-path: hrsh7th/cmp-path#68

Temporarily working around this by disabling cmp-cmdline on e and edit:

  -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
  cmp.setup.cmdline(':', {
    mapping = cmp.mapping.preset.cmdline(),
    sources = cmp.config.sources({
		{ name = 'path' },
		{ name = 'cmdline', option = { ignore_cmds = { 'Man', '!', 'e', 'edit'}}}
	})
  })

@girishji
Copy link

girishji commented Aug 1, 2023

It is possible to get around blocking calls that take a long time. I wrote a autocompletion plugin (https://github.com/girishji/autosuggest.vim) for cmdline-mode completion in vim9script. I solved this problem by adding a timeout to job_start(). There are certain completions that are long running (like ** expansion). I check them first in a separate process. I assume similar mechanism can be used in neovim as well.

@miekg
Copy link

miekg commented Feb 7, 2024

hitting this too.

I would be happy (enough) with the ability to exclude some paths from cmp-path completion as a work-around (happy to file a feature request under cmp-path if desired)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants