aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c_hardflip.go4
-rw-r--r--i_events.go8
2 files changed, 6 insertions, 6 deletions
diff --git a/c_hardflip.go b/c_hardflip.go
index ca3c76f..94e6211 100644
--- a/c_hardflip.go
+++ b/c_hardflip.go
@@ -58,7 +58,7 @@ type HardData struct {
ui HardUI
opts HardOpts
data_dir string
- folds map[*ItemsNode]*ItemsList
+ folds map[*DirsNode]*ItemsList
}
func main() {
@@ -72,7 +72,7 @@ func main() {
HardUI{},
opts,
data_dir,
- make(map[*ItemsNode]*ItemsList),
+ make(map[*DirsNode]*ItemsList),
}
i_ui(&data)
}
diff --git a/i_events.go b/i_events.go
index 99907cf..75beb40 100644
--- a/i_events.go
+++ b/i_events.go
@@ -74,10 +74,10 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) {
}
func i_unfold_dir(data *HardData, item *ItemsNode) {
- if item == nil {
+ if item == nil || item.Dirs == nil {
return
}
- fold := data.folds[item]
+ fold := data.folds[item.Dirs]
if fold == nil {
return
}
@@ -94,7 +94,7 @@ func i_unfold_dir(data *HardData, item *ItemsNode) {
} else {
data.litems.last = fold.last
}
- delete(data.folds, item)
+ delete(data.folds, item.Dirs)
for ptr := data.litems.head; ptr.next != nil; ptr = ptr.next {
ptr.next.ID = ptr.ID + 1
}
@@ -136,7 +136,7 @@ func i_fold_dir(data *HardData, item *ItemsNode) {
data.litems.last = item
}
- folds[item] = &tmp
+ folds[item.Dirs] = &tmp
for ptr := data.litems.head; ptr.next != nil; ptr = ptr.next {
ptr.next.ID = ptr.ID + 1
}