aboutsummaryrefslogtreecommitdiffstats
path: root/i_events.go
diff options
context:
space:
mode:
Diffstat (limited to 'i_events.go')
-rw-r--r--i_events.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/i_events.go b/i_events.go
index ccc35b8..f1cf3c4 100644
--- a/i_events.go
+++ b/i_events.go
@@ -76,9 +76,7 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) {
func i_set_unfold(data *HardData, item *ItemsNode) {
delete(data.folds, item.Dirs)
- for ptr := data.litems.head; ptr != nil && ptr.next != nil; ptr = ptr.next {
- ptr.next.ID = ptr.ID + 1
- }
+ data.litems.reset_id()
}
func i_unfold_dir(data *HardData, item *ItemsNode) {
@@ -123,9 +121,7 @@ func i_set_fold(data *HardData, curr, start, end *ItemsNode) {
}
folds[curr.Dirs] = &tmp
- for ptr := data.litems.head; ptr != nil && ptr.next != nil; ptr = ptr.next {
- ptr.next.ID = ptr.ID + 1
- }
+ data.litems.reset_id()
}
func i_fold_dir(data *HardData, item *ItemsNode) {
@@ -200,9 +196,7 @@ func i_delete_dir(data *HardData) {
data.litems.last = curr.prev
data.litems.curr = curr.prev
}
- for ptr := data.litems.head; ptr != nil && ptr.next != nil; ptr = ptr.next {
- ptr.next.ID = ptr.ID + 1
- }
+ data.litems.reset_id()
if err := os.RemoveAll(dir_path); err != nil {
data.ui.s.Fini()
c_die("can't remove " + dir_path, err)