From 2f8a224b62402a32fc319f333722838e747bc7f3 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 15 Jan 2024 20:20:20 +0100 Subject: honestly i dont know how this can work --- i_events.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'i_events.go') diff --git a/i_events.go b/i_events.go index bdc4afe..1043bc5 100644 --- a/i_events.go +++ b/i_events.go @@ -63,12 +63,17 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) { return } // HACK: find workaround to kill ids - virt_id := litems.curr.ID - (ui.dim[H] - 4) + 4 + scrolloff := 4 + if litems.last.ID - (ui.dim[H] - 4) <= litems.draw.ID { + scrolloff = 0 + } + virt_id := litems.curr.ID - (ui.dim[H] - 4) + scrolloff for litems.draw.ID < virt_id && litems.draw.next != nil { litems.draw = litems.draw.next } - for litems.draw.ID > litems.curr.ID - 4 && + scrolloff = 4 + for litems.draw.ID > litems.curr.ID - scrolloff && litems.draw.prev != nil { litems.draw = litems.draw.prev } -- cgit v1.2.3