gitsigns.nvim
gitsigns.nvim copied to clipboard
FS events instead of polling?
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)
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.
Oooo exciting :)