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:
BIN
bin/analyze-go
BIN
bin/analyze-go
Binary file not shown.
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user