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

FS events instead of polling #598

Closed
will opened this issue Jul 26, 2022 · 2 comments · Fixed by #660
Closed

FS events instead of polling #598

will opened this issue Jul 26, 2022 · 2 comments · Fixed by #660
Labels
enhancement New feature or request

Comments

@will
Copy link

will commented Jul 26, 2022

Do you think it'd be both A) possible and B) worth it to use https://github.com/luvit/luv/blob/master/docs.md#uv_fs_event_t--fs-event-handle instead of polling the git directory for changes?

The libuv bindings all works for me on macOS, haven't tried on a linux yet, but the docs seem to say that they make it work for every platform

local fse = vim.loop.new_fs_event()
local path = vim.fn.expand("%:p")

vim.loop.fs_event_start(fse, path, {}, function(err, filename, events)
  vim.notify(vim.inspect(err) .. vim.inspect(filename) .. vim.inspect(events))
end)
@will will added the enhancement New feature or request label Jul 26, 2022
@lewis6991
Copy link
Owner

I initially tried fs events, however I found they were causing 100% CPU utilisation on my Mac.

This was over a year a go so libuv may have fixed this issue by now, but will need to check.

@lewis6991 lewis6991 linked a pull request Oct 30, 2022 that will close this issue
@lewis6991 lewis6991 changed the title FS events instead of polling? FS events instead of polling Nov 8, 2022
@will
Copy link
Author

will commented Jun 19, 2023

Oooo exciting :)

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

Successfully merging a pull request may close this issue.

2 participants