Skip to content

Commit

Permalink
feat(events): pass last output to before
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelot committed Jan 18, 2022
1 parent 4cfbcc2 commit 1f7cada
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/heirline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ function M.setup(statusline, events)
M.load()
end

local last_out = ""
function M.eval()
if M.events.before then
M.events.before(M.statusline)
M.events.before(M.statusline, last_out)
end
local out = M.statusline:eval()
if M.events.after then
out = M.events.after(M.statusline, out)
end
last_out = out
return out
end

Expand Down

0 comments on commit 1f7cada

Please sign in to comment.