From cb445d32cf678ba4971ce8c41ed252c1eeb27562 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 15 Jan 2024 20:20:20 +0100 Subject: fuck sel_max --- i_events.go | 6 ------ i_ui.go | 5 ++--- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/i_events.go b/i_events.go index d1cd8e4..c73895e 100644 --- a/i_events.go +++ b/i_events.go @@ -172,7 +172,6 @@ func i_reload_data(data *HardData) { data.ldirs = c_load_data_dir(data.data_dir, data.opts) data.litems = c_load_litems(data.ldirs) data.folds = make(map[*DirsNode]*ItemsList) - data.ui.sel_max = data.litems.last.ID } func i_delete_dir(data *HardData) { @@ -237,11 +236,6 @@ func i_delete_host(data *HardData) { tmp = data.litems.head } data.litems.curr = tmp - if data.litems.last != nil { - data.ui.sel_max = data.litems.last.ID - } else { - data.ui.sel_max = 0 - } } // screen events such as keypresses diff --git a/i_ui.go b/i_ui.go index 2177ce3..c3e1793 100644 --- a/i_ui.go +++ b/i_ui.go @@ -62,7 +62,6 @@ type HardUI struct { mode uint8 // HACK: fuck sel_max // HACK: lists ids might be shit too - sel_max int def_style tcell.Style dir_style tcell.Style title_style tcell.Style @@ -305,12 +304,12 @@ func i_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) { line++ } } - if litems.head == nil { + if litems.head != nil { i_draw_text(ui.s, 1, ui.dim[H] - 2, (ui.dim[W] / 3) - 1, ui.dim[H] - 2, ui.def_style, " " + strconv.Itoa(litems.curr.ID) + "/" + - strconv.Itoa(int(ui.sel_max)) + " items ") + strconv.Itoa(int(litems.last.ID)) + " items ") } else { i_draw_text(ui.s, 1, ui.dim[H] - 2, (ui.dim[W] / 3) - 1, ui.dim[H] - 2, -- cgit v1.2.3