Skip to content

Commit

Permalink
fix(manager): ignore updates after destruction (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
b0o committed Jan 25, 2024
1 parent 7f45685 commit 32cf855
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lua/incline/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ local state = M.state

-- TODO: Certain events like CursorHold/CursorMoved should only re-render the focused winline
M.update = Debounce(function(opts)
if not state.initialized then
return
end
opts = opts or {}
local events = state.events
local changes = {}
Expand Down Expand Up @@ -86,7 +89,7 @@ M.win_get_winline = function(win)
return tab:get_winline(win)
end

local function destroy()
M.destroy = function()
if not state.initialized then
return
end
Expand All @@ -100,10 +103,6 @@ local function destroy()
state.initialized = false
end

M.destroy = function()
vim.schedule(destroy)
end

M.setup = function()
if state.initialized then
M.update.threshold = config.debounce_threshold
Expand Down

0 comments on commit 32cf855

Please sign in to comment.