mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Make linemode spacing consistent between solo and children_add linemodes
This commit is contained in:
parent
907ac09e34
commit
ea674d61d9
1 changed files with 5 additions and 6 deletions
|
|
@ -14,14 +14,10 @@ function Linemode:solo()
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self[mode] then
|
if not self[mode] then
|
||||||
return ui.Line(" " .. mode .. " ")
|
return ui.Line(mode)
|
||||||
end
|
end
|
||||||
|
|
||||||
return ui.Line {
|
return ui.Line { self[mode](self) }
|
||||||
ui.Span(" "),
|
|
||||||
self[mode](self),
|
|
||||||
ui.Span(" "),
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function Linemode:size()
|
function Linemode:size()
|
||||||
|
|
@ -63,6 +59,9 @@ function Linemode:render()
|
||||||
local lines = {}
|
local lines = {}
|
||||||
for _, c in ipairs(self._children) do
|
for _, c in ipairs(self._children) do
|
||||||
lines[#lines + 1] = (type(c[1]) == "string" and self[c[1]] or c[1])(self)
|
lines[#lines + 1] = (type(c[1]) == "string" and self[c[1]] or c[1])(self)
|
||||||
|
if lines[#lines] and lines[#lines]:width() > 0 then
|
||||||
|
lines[#lines + 1] = ui.Line { ui.Span(" ") }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return ui.Line(lines)
|
return ui.Line(lines)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue