Dircounts should have a width of 5 when displaying (#2072)
This commit is contained in:
1 parent
b0c3f8dbd7
commit
0a05a7106d
2 files changed
+6
-6
No files matched your search
@@ -105,7 +105,7 @@ func newFile(path string) *file {
|
||||
if err != nil {
|
||||
dirCount = -2
|
||||
} else {
|
||||
names, err := d.Readdirnames(1000)
|
||||
names, err := d.Readdirnames(10000)
|
||||
d.Close()
|
||||
|
||||
if names == nil && err != io.EOF {
|
||||
|
||||
@@ -301,13 +301,13 @@ func fileInfo(f *file, d *dir, userWidth int, groupWidth int, customWidth int) (
|
||||
if f.IsDir() && getDirCounts(d.path) {
|
||||
switch {
|
||||
case f.dirCount < -1:
|
||||
info.WriteString(" !")
|
||||
info.WriteString(" !")
|
||||
case f.dirCount < 0:
|
||||
info.WriteString(" ?")
|
||||
case f.dirCount < 1000:
|
||||
fmt.Fprintf(&info, " %4d", f.dirCount)
|
||||
info.WriteString(" ?")
|
||||
case f.dirCount < 10000:
|
||||
fmt.Fprintf(&info, " %5d", f.dirCount)
|
||||
default:
|
||||
info.WriteString(" 999+")
|
||||
info.WriteString(" 9999+")
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user