Skip to content

Commit

Permalink
alignments and formats
Browse files Browse the repository at this point in the history
  • Loading branch information
deadc0de6 committed Feb 23, 2024
1 parent a02c9a2 commit a9e6ae6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion internal/navigator/navigator.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (a *Navigator) eventHandler(eventKey *tcell.EventKey) *tcell.EventKey {
a.selectedFlag = true
a.app.Stop()
return nil
} else if eventKey.Rune() == 'h' || eventKey.Key() == tcell.KeyLeft {
} else if eventKey.Rune() == 'h' || eventKey.Key() == tcell.KeyLeft || eventKey.Key() == tcell.KeyBackspace2 {
// open parent directory
a.goBackFlag = true
a.app.Stop()
Expand All @@ -99,6 +99,7 @@ func (a *Navigator) eventHandler(eventKey *tcell.EventKey) *tcell.EventKey {
a.app.Stop()
return nil
} else if eventKey.Rune() == 'L' {
// toggle long mode
a.longMode = !a.longMode
a.reloadFlag = true
a.app.Stop()
Expand Down
6 changes: 3 additions & 3 deletions internal/node/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ func (n *StorageNode) GetAttr(rawSize bool, long bool) map[string]string {
attrs["nbfiles"] = fmt.Sprintf("%d", n.TotalFiles)
attrs["size"] = sizeToString(n.Size, rawSize)
total := sizeToString(n.Total, rawSize)
attrs["fs_size"] = total
attrs["fs_size"] = fmt.Sprintf("%-6s", total)
freePercent := "??"
if n.Total != 0 {
freePercent = fmt.Sprintf("%d%%", n.Free*100/n.Total)
}
attrs["fs_free"] = freePercent
attrs["fs_free"] = fmt.Sprintf("%3s", freePercent)
used := sizeToString(n.Total-n.Free, rawSize)
attrs["fs_du"] = fmt.Sprintf("%s/%s", used, total)
attrs["fs_du"] = fmt.Sprintf("%6s/%6s", used, total)
attrs["indexed"] = utils.DateToString(n.IndexedAt)

attrs["meta"] = n.Meta
Expand Down
2 changes: 1 addition & 1 deletion internal/stringer/attrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func attrToStringColored(key string, value string, cm *colorme.ColorMe) string {
} else if key == "mode" {
line = cm.InYellow(value)
} else if key == "size" {
line = cm.InGreen(fmt.Sprintf("%-6s", value))
line = cm.InGreen(fmt.Sprintf("%6s", value))
} else if key == "type" {
line = cm.InRed(fmt.Sprintf("%-4s", value))
} else {
Expand Down

0 comments on commit a9e6ae6

Please sign in to comment.