diff options
Diffstat (limited to '_usage_footer.lua')
| -rw-r--r-- | _usage_footer.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/_usage_footer.lua b/_usage_footer.lua index 2c27e8b..421afd5 100644 --- a/_usage_footer.lua +++ b/_usage_footer.lua @@ -130,6 +130,7 @@ function M.install(ext) state = { sections = {} } package.loaded[slot] = state ext.on("render_footer", function(event) + if event.has_tui == false then return end local inner = event:get_component() state.handle = event:set_component({ render = function(_, width) @@ -147,6 +148,7 @@ function M.install(ext) return lines end, }) + if state.handle and next(state.sections) then start_clock(state) end end) ext.on("session_end", function() state.closed = true @@ -169,8 +171,10 @@ function M.publish(ext, key, section, windows, status, opts) end if type(section) ~= "function" and type(section) ~= "string" then return false end state.sections[key] = section - start_clock(state) - if state.handle then state.handle:invalidate() end + if state.handle then + start_clock(state) + state.handle:invalidate() + end return true end |
