aboutsummaryrefslogtreecommitdiffstats
path: root/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
commit302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47 (patch)
tree0bd3082ad6e04c7008f9c4a443ed1abfc665cbdf /i_events.go
parentcleaner (diff)
downloadhardflip-302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47.tar.gz
hardflip-302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47.tar.bz2
hardflip-302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47.tar.xz
hardflip-302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47.tar.zst
hardflip-302ef8cfa60d2d7c6236e1dd7821750e4e1e8a47.zip
cleaner i guess
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)