From 4b53134ce5fdd58e6c52c49fb906b6e7a347d137 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Thu, 6 Jun 2024 16:58:19 +0100 Subject: [PATCH] fix(watcher): workaround weird annoying libuv bug Fixes #1027 --- lua/gitsigns.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/gitsigns.lua b/lua/gitsigns.lua index 6ce3a6f8c..78a786221 100644 --- a/lua/gitsigns.lua +++ b/lua/gitsigns.lua @@ -69,6 +69,11 @@ local update_cwd_head = async.create(function() if cwd_watcher then cwd_watcher:stop() + -- TODO(lewis6991): (#1027) Running `fs_event:stop()` -> `fs_event:start()` + -- in the same loop event, on Windows, causes Nvim to hang on quit. + if vim.fn.has('win32') then + async.scheduler() + end else cwd_watcher = assert(uv.new_fs_event()) end