Reorder info line: N/M (X) (S%) +S +T*
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled

Flags that appear/disappear are now at the end, so the multi-select
indicator stays in a fixed position and doesn't flicker.
This commit is contained in:
Junegunn Choi
2026-03-14 22:10:55 +09:00
parent b5f7221580
commit 17f2aa1a1f
2 changed files with 12 additions and 12 deletions

View File

@@ -3030,6 +3030,16 @@ func (t *Terminal) printInfoImpl() {
found := t.resultMerger.Length()
total := max(found, t.count)
output := fmt.Sprintf("%d/%d", found, total)
if t.multi > 0 {
if t.multi == maxMulti {
output += fmt.Sprintf(" (%d)", len(t.selected))
} else {
output += fmt.Sprintf(" (%d/%d)", len(t.selected), t.multi)
}
}
if t.progress > 0 && t.progress < 100 {
output += fmt.Sprintf(" (%d%%)", t.progress)
}
if t.toggleSort {
if t.sort {
output += " +S"
@@ -3050,16 +3060,6 @@ func (t *Terminal) printInfoImpl() {
output += " +t"
}
}
if t.multi > 0 {
if t.multi == maxMulti {
output += fmt.Sprintf(" (%d)", len(t.selected))
} else {
output += fmt.Sprintf(" (%d/%d)", len(t.selected), t.multi)
}
}
if t.progress > 0 && t.progress < 100 {
output += fmt.Sprintf(" (%d%%)", t.progress)
}
if t.failed != nil && t.count == 0 {
output = fmt.Sprintf("[Command failed: %s]", *t.failed)
}