From 1547035da000d94ca0fa9b794ddaa651952c1b97 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 10 Jan 2024 20:20:20 +0100 Subject: kinda works i guess --- i_events.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'i_events.go') diff --git a/i_events.go b/i_events.go index 8cf9a82..e9f50bb 100644 --- a/i_events.go +++ b/i_events.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_events.go - * Wed Jan 10 11:30:31 2024 + * Wed Jan 10 12:04:16 2024 * Joe * * events in the code @@ -93,14 +93,29 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) { } func i_fold_dir(data *HardData, item *ItemsNode) { - litems := data.litems + if item == nil { + return + } + // litems := data.litems folds := data.folds - - folds[item] = &ItemsList{ - nil, + folded_start := item.next + folded_start.prev = nil + folded_end := item + for i := 0; i < item.Dirs.count_elements() && folded_end != nil; i++ { + folded_end = folded_end.next + } + after := folded_end.next + folded_end.next = nil + tmp := ItemsList{ + folded_start, + folded_end, nil, nil, } + item.next = after + after.prev = item + + folds[item] = &tmp } func i_reload_data(data *HardData) { -- cgit v1.2.3