From 03fceeecf27ac6d5339698cc2596ac6ad34d90cd Mon Sep 17 00:00:00 2001 From: Integral Date: Thu, 21 Nov 2024 13:30:53 +0800 Subject: [PATCH] fix: show "0/0" instead of "1/0" in empty directories --- yazi-plugin/preset/components/status.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yazi-plugin/preset/components/status.lua b/yazi-plugin/preset/components/status.lua index e31a49f2..74b99b08 100644 --- a/yazi-plugin/preset/components/status.lua +++ b/yazi-plugin/preset/components/status.lua @@ -126,7 +126,7 @@ function Status:position() local style = self:style() return ui.Line { ui.Span(THEME.status.separator_open):fg(style.bg):bg(THEME.status.separator_style.fg), - ui.Span(string.format(" %2d/%-2d ", cursor + 1, length)):style(style), + ui.Span(string.format(" %2d/%-2d ", math.min(cursor + 1, length), length)):style(style), ui.Span(THEME.status.separator_close):fg(style.bg), } end