1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-15 17:30:05 +00:00

Optimization of large file list display

This commit is contained in:
Tw93
2025-11-16 09:03:35 +08:00
parent bebcf4d166
commit a5663f70d4
2 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@@ -1074,6 +1074,7 @@ func (m model) View() string {
file := m.largeFiles[idx] file := m.largeFiles[idx]
shortPath := displayPath(file.path) shortPath := displayPath(file.path)
shortPath = truncateMiddle(shortPath, 35) shortPath = truncateMiddle(shortPath, 35)
paddedPath := padName(shortPath, 35)
entryPrefix := " " entryPrefix := " "
nameColor := "" nameColor := ""
sizeColor := colorGray sizeColor := colorGray
@@ -1087,7 +1088,7 @@ func (m model) View() string {
size := humanizeBytes(file.size) size := humanizeBytes(file.size)
bar := coloredProgressBar(file.size, maxLargeSize, 0) bar := coloredProgressBar(file.size, maxLargeSize, 0)
fmt.Fprintf(&b, "%s%s%2d.%s %s | 📄 %s%s%s %s%10s%s\n", fmt.Fprintf(&b, "%s%s%2d.%s %s | 📄 %s%s%s %s%10s%s\n",
entryPrefix, numColor, idx+1, colorReset, bar, nameColor, shortPath, colorReset, sizeColor, size, colorReset) entryPrefix, numColor, idx+1, colorReset, bar, nameColor, paddedPath, colorReset, sizeColor, size, colorReset)
} }
} }
} else { } else {