From 8efd53677a2dcb802a24ba9deb52801981f33b4f Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 10 Jan 2024 20:20:20 +0100 Subject: good --- i_events.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/i_events.go b/i_events.go index e9f50bb..587aefa 100644 --- a/i_events.go +++ b/i_events.go @@ -96,7 +96,7 @@ func i_fold_dir(data *HardData, item *ItemsNode) { if item == nil { return } - // litems := data.litems + litems := data.litems folds := data.folds folded_start := item.next folded_start.prev = nil @@ -113,9 +113,16 @@ func i_fold_dir(data *HardData, item *ItemsNode) { nil, } item.next = after - after.prev = item + if after == nil { + litems.last = item + } else { + after.prev = item + } folds[item] = &tmp + for ptr := litems.head; ptr.next != nil; ptr = ptr.next { + ptr.next.ID = ptr.ID + 1 + } } func i_reload_data(data *HardData) { -- cgit v1.2.3