summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-03-21 10:03:51 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-03-30 21:57:00 +1100
commit46b79c7c61b718644e0d31f533c6e15a95475245 (patch)
treeb457f4220668dc0fff0b2f0c4e6ee3927a187993 /pkg/commands
parent4782d8aa1f9f3917483aefa580ecc91ab37ec7dc (diff)
drop Name field from status line node
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/models/status_line_node.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/commands/models/status_line_node.go b/pkg/commands/models/status_line_node.go
index 0bf3e8c3d..94527ee9f 100644
--- a/pkg/commands/models/status_line_node.go
+++ b/pkg/commands/models/status_line_node.go
@@ -11,7 +11,6 @@ import (
type StatusLineNode struct {
Children []*StatusLineNode
File *File
- Name string // e.g. 'mydir'
Path string // e.g. '/path/to/mydir'
Collapsed bool
}
@@ -146,7 +145,7 @@ func (s *StatusLineNode) sortChildren() {
return false
}
- return sortedChildren[i].Name < sortedChildren[j].Name
+ return sortedChildren[i].Path < sortedChildren[j].Path
})
// TODO: think about making this in-place
@@ -243,7 +242,7 @@ func (s *StatusLineNode) ForEachFile(cb func(*File) error) error {
}
func (s *StatusLineNode) NameAtDepth(depth int) string {
- splitName := strings.Split(s.Name, string(os.PathSeparator))
+ splitName := strings.Split(s.Path, string(os.PathSeparator))
name := filepath.Join(splitName[depth:]...)
if s.File != nil && s.File.IsRename() {