Skip to content

Commit

Permalink
feat(statusline)!: stop_at_first -> stop_when(self, child_out)
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelot committed Jan 18, 2022
1 parent cd30484 commit 8bbe790
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/heirline/statusline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local utils = require("heirline.utils")
local hi = require("heirline.highlights")

local default_restrict = {
stop_at_first = true,
stop_when = true,
init = true,
provider = true,
condition = true,
Expand All @@ -27,7 +27,7 @@ function StatusLine:new(child)
new.condition = child.condition
new.init = child.init
new.provider = child.provider
new.stop_at_first = child.stop_at_first
new.stop_when = child.stop_when
new.restrict = child.restrict and vim.tbl_extend("keep", child.restrict, {})

if child.static then
Expand Down Expand Up @@ -86,7 +86,7 @@ function StatusLine:eval()
for _, child in ipairs(self) do
local out = child:eval()
table.insert(stl, out)
if self.stop_at_first and out ~= "" then
if self.stop_when and self:stop_when(out) then
break
end
end
Expand Down

0 comments on commit 8bbe790

Please sign in to comment.