From e31d2149d9f3fb056bfd5b3416b2e818be10aabe Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Wed, 5 Jun 2024 10:17:10 +0100 Subject: [PATCH] fix: add workaround for Lazy issue --- lua/gitsigns.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/gitsigns.lua b/lua/gitsigns.lua index cfff4472c..6ce3a6f8c 100644 --- a/lua/gitsigns.lua +++ b/lua/gitsigns.lua @@ -17,6 +17,10 @@ local cwd_watcher ---@type uv.uv_fs_event_t? local function get_gitdir_and_head() local cwd = assert(uv.cwd()) + -- Run on the main loop to avoid: + -- https://github.com/LazyVim/LazyVim/discussions/3407#discussioncomment-9622211 + async.scheduler() + -- Look in the cache first for _, bcache in pairs(require('gitsigns.cache').cache) do local repo = bcache.git_obj.repo