From 3b8e8cc804e52b780460d95d3c7ea0dd90f582ba Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 9 Jan 2024 20:20:20 +0100 Subject: its hard tho --- i_events.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/i_events.go b/i_events.go index b0e904e..cda0427 100644 --- a/i_events.go +++ b/i_events.go @@ -52,7 +52,7 @@ package main import ( - // "fmt" + "fmt" "os" "github.com/gdamore/tcell/v2" @@ -72,29 +72,29 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) { if litems.draw_start == nil || litems.curr == nil { return } - virt_id := litems.curr.ID - (ui.dim[H] - 4) // - ui.folded_count + virt_id := litems.curr.ID - (ui.dim[H] - 4) - ui.folded_count for litems.draw_start.ID < virt_id && litems.draw_start.next != nil { litems.draw_start = litems.draw_start.next - } for litems.draw_start.ID > litems.curr.ID && litems.draw_start.prev != nil { litems.draw_start = litems.draw_start.prev } // fmt.Println(">>>>> DRAW_START:", litems.draw_start.ID, "<<<<<<< >>>>>>>> VIRT_ID:", virt_id) - // if litems.draw_start.prev != nil && - // litems.draw_start.prev.is_dir() == true && - // litems.draw_start.prev.Dirs.Folded == true { - // tmp := litems.draw_start.prev.Dirs.count_elements() - // for i := 0; i < tmp && litems.draw_start != nil; i++ { - // litems.draw_start = litems.draw_start.next - // } - // } + if litems.draw_start.prev != nil && + litems.draw_start.prev.is_dir() == true && + litems.draw_start.prev.Dirs.Folded == true { + // tmp := litems.draw_start.prev.Dirs.count_elements() + // for i := 0; i < tmp && litems.draw_start != nil; i++ { + // litems.draw_start = litems.draw_start.next + // } + } } func i_reload_data(data *HardData) { // FIX: segv if data dir is removed + fmt.Println("remove me sometime") data.ldirs = c_load_data_dir(data.data_dir, data.opts) data.litems = c_load_litems(data.ldirs) data.ui.sel_max = data.litems.last.ID -- cgit v1.2.3