mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-08 02:35:44 +02:00
fix: race condition when stopping loading timer (#331)
On Neovim 0.10, calling timer:stop() is not canceling the callback. There appears to be some minimum amount of buffer time remaining in the timer in order for it to be able to be canceled correctly. I'm getting around this by adding a simple guard statement
This commit is contained in:
parent
8ccc18055b
commit
cf69a43c08
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,9 @@ M.set_loading = function(aer_bufnr, is_loading)
|
|||
0,
|
||||
80,
|
||||
vim.schedule_wrap(function()
|
||||
if not timers[aer_bufnr] then
|
||||
return
|
||||
end
|
||||
local lines = { M.spinner_frames[i + 1] .. " Loading" }
|
||||
util.render_centered_text(aer_bufnr, lines)
|
||||
i = (i + 1) % #M.spinner_frames
|
||||
|
|
Loading…
Reference in a new issue