fix: ensure the status bar always has the directory length available (#3810)

This commit is contained in:
三咲雅 misaki masa 2026-03-24 22:12:23 +08:00 committed by GitHub
parent e2fae151a5
commit 5b2dd41e64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,7 @@ Status = {
_inc = 1000, _inc = 1000,
_left = { _left = {
{ "mode", id = 1, order = 1000 }, { "mode", id = 1, order = 1000 },
{ "size", id = 2, order = 2000 }, { "length", id = 2, order = 2000 },
{ "name", id = 3, order = 3000 }, { "name", id = 3, order = 3000 },
}, },
_right = { _right = {
@ -47,9 +47,9 @@ function Status:mode()
} }
end end
function Status:size() function Status:length()
local h = self._current.hovered local h = self._current.hovered
local size = h and (h:size() or h.cha.len) or 0 local size = h and h.cha.len or 0
local style = self:style() local style = self:style()
return ui.Line { return ui.Line {