diff --git a/lua/gitsigns/attach.lua b/lua/gitsigns/attach.lua index 197472904..bd65afc50 100644 --- a/lua/gitsigns/attach.lua +++ b/lua/gitsigns/attach.lua @@ -124,7 +124,9 @@ local setup = util.once(function() return end bcache:invalidate(true) - manager.update(buf) + async.run(function() + manager.update(buf) + end) end, }) diff --git a/lua/gitsigns/manager.lua b/lua/gitsigns/manager.lua index 4b0bdf0cc..63c9037ee 100644 --- a/lua/gitsigns/manager.lua +++ b/lua/gitsigns/manager.lua @@ -454,6 +454,7 @@ function M.schedule(bufnr, check_compare_text) return true end +--- @async --- Ensure updates cannot be interleaved. --- Since updates are asynchronous we need to make sure an update isn't performed --- whilst another one is in progress. If this happens then schedule another