diff options
-rw-r--r-- | i_events.go | 11 |
1 files 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) { |