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

feat: use vim.uv.spawn instead of vim.fn.jobstart #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

delphinus
Copy link

The current code uses vim.schedule_wrap to call vim.fn.jobstart for running rg. This can be replaced by uv.spawn that can be called “in fast event”. This makes it run rg as soon as cmp starts to complete.

But this change has 2 problems.

  • vim.fn.json_decode cannot be called in fast event. We should always use vim.json.decode, so we must remove support for Neovim older than v0.6.
  • uv.spawn always run a process directly (without shell). Now additional_arguments option should be an array instead of string.

I think benefits we can get by this change are larger than these breaking changes.

@lukas-reineke
Copy link
Owner

Does this actually make a different to the performance?
Can you profile this?

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

Successfully merging this pull request may close these issues.

None yet

2 participants