gitsigns.nvim icon indicating copy to clipboard operation
gitsigns.nvim copied to clipboard

FS events instead of polling?

Open will opened this issue 3 years ago • 1 comments

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 avatar Jul 26 '22 02:07 will

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 avatar Jul 28 '22 06:07 lewis6991

Oooo exciting :)

will avatar Jun 19 '23 13:06 will