From 43e669eb01791b87ed570ab424a66984f26da399 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 10 Jan 2024 20:20:20 +0100 Subject: tmp --- i_events.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'i_events.go') diff --git a/i_events.go b/i_events.go index 8caf2d5..8cf9a82 100644 --- a/i_events.go +++ b/i_events.go @@ -92,6 +92,17 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) { // } } +func i_fold_dir(data *HardData, item *ItemsNode) { + litems := data.litems + folds := data.folds + + folds[item] = &ItemsList{ + nil, + nil, + nil, + } +} + func i_reload_data(data *HardData) { // TODO: remove this after debug fmt.Println("remove me sometime") @@ -164,10 +175,10 @@ func i_events(data *HardData) { data.litems.draw_start = data.litems.head } else if event.Rune() == 'G' { data.litems.curr = data.litems.last - for data.litems.curr.prev != nil && - data.litems.curr.folded_parents() == true { - data.litems.curr = data.litems.curr.prev - } + // for data.litems.curr.prev != nil && + // data.litems.curr.folded_parents() == true { + // data.litems.curr = data.litems.curr.prev + // } } else if event.Rune() == 'D' && data.ldirs.head != nil && ui.sel_max != 0 { @@ -195,6 +206,7 @@ func i_events(data *HardData) { } else { data.litems.curr.Dirs.Folded = false } + i_fold_dir(data, data.litems.curr) } } else if event.Rune() == ' ' { if data.litems.curr == nil || -- cgit v1.2.3