diff --git a/lua/incline/manager.lua b/lua/incline/manager.lua index 129d53c..07e4e74 100644 --- a/lua/incline/manager.lua +++ b/lua/incline/manager.lua @@ -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 = {} @@ -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 @@ -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