diff options
author | joe <rbo@gmx.us> | 2025-08-26 12:10:43 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-08-26 12:10:43 +0200 |
commit | b8fde0598ef9914a6af4f6e4d029a7bb78e84dcf (patch) | |
tree | 8b9f089b4b9e264dfc5742ffdaa72dc13e3af295 | |
parent | make release unrelated (diff) | |
download | hardflip-b8fde0598ef9914a6af4f6e4d029a7bb78e84dcf.tar.gz hardflip-b8fde0598ef9914a6af4f6e4d029a7bb78e84dcf.tar.bz2 hardflip-b8fde0598ef9914a6af4f6e4d029a7bb78e84dcf.tar.xz hardflip-b8fde0598ef9914a6af4f6e4d029a7bb78e84dcf.tar.zst hardflip-b8fde0598ef9914a6af4f6e4d029a7bb78e84dcf.zip |
reverted all fuzzmode shit but there is still a lot of crap
-rw-r--r-- | src/e_keys.go | 3 | ||||
-rw-r--r-- | src/i_host.go | 39 | ||||
-rw-r--r-- | src/i_info.go | 2 | ||||
-rw-r--r-- | src/i_ui.go | 19 |
4 files changed, 3 insertions, 60 deletions
diff --git a/src/e_keys.go b/src/e_keys.go index 0158450..ea3f61f 100644 --- a/src/e_keys.go +++ b/src/e_keys.go @@ -262,7 +262,8 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool { } else if (event.Rune() == '/' || event.Key() == tcell.KeyCtrlF) && data.litems.curr != nil { - ui.mode = FUZZ_MODE + // ui.mode = FUZZ_MODE + // TODO: fzf here } else if event.Rune() == '?' { ui.mode = HELP_MODE ui.help_scroll = 0 diff --git a/src/i_host.go b/src/i_host.go index 92ec32f..6605c6b 100644 --- a/src/i_host.go +++ b/src/i_host.go @@ -87,7 +87,6 @@ func i_host_panel_host(ui HardUI, icons bool, } } if host == curr { - // style = style.Background(tcell.ColorBlack) style = style.Reverse(true) } text := " " @@ -110,8 +109,6 @@ func i_host_panel_host(ui HardUI, icons bool, func i_draw_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) { - if ui.mode == FUZZ_MODE { - } i_draw_box(ui.s, 0, 0, ui.dim[W] / 3, ui.dim[H] - 2, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], " Hosts ", false) @@ -119,15 +116,7 @@ func i_draw_host_panel(ui HardUI, icons bool, if litems == nil || litems.head == nil { return } - // if ui.mode == FUZZ_MODE && data.lfuzz != nil { - // i_draw_host_panel_fuzzy(ui, icons, data.lfuzz, data) - // // TODO: draw fuzz list - // return - // } for ptr := litems.draw; ptr != nil && line < ui.dim[H] - 2; ptr = ptr.next { - if ui.mode == FUZZ_MODE && i_fuzz_check(ptr, &ui) == false { - continue - } if ptr.is_dir() == false && ptr.Host != nil { i_host_panel_host(ui, icons, @@ -151,31 +140,3 @@ func i_draw_host_panel(ui HardUI, icons bool, } } } - -func i_fuzz_check(ptr *ItemsNode, ui *HardUI) bool { - name := "" - var name_runes []rune - var end_runes []rune - - if len(ui.buff.data) == 0 { - return true - } - if ptr.is_dir() == false && ptr.Host != nil { - name = ptr.Host.Name - } else if ptr.Dirs != nil { - name = ptr.Dirs.Name - } - name_runes = []rune(name) - for _, buff_ptr := range ui.buff.data { - for _, name_ptr := range name_runes { - if buff_ptr == name_ptr { - end_runes = append(end_runes, buff_ptr) - } - } - if len(end_runes) == 0 { - return false - } - // TODO: here - } - return true -} diff --git a/src/i_info.go b/src/i_info.go index e2aaba4..4802feb 100644 --- a/src/i_info.go +++ b/src/i_info.go @@ -467,8 +467,6 @@ func i_info_note(ui HardUI, host *HostNode, line int) { func i_draw_info_panel(ui HardUI, percent bool, litems *ItemsList) { type info_func func(HardUI, *HostNode, int) int - if ui.mode == FUZZ_MODE { - } i_draw_box(ui.s, (ui.dim[W] / 3), 0, ui.dim[W] - 1, ui.dim[H] - 2, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], " Infos ", false) diff --git a/src/i_ui.go b/src/i_ui.go index 486cc29..d9b8925 100644 --- a/src/i_ui.go +++ b/src/i_ui.go @@ -226,9 +226,6 @@ func i_set_box_style(ui *HardUI) { RENAME_MODE: ui.style[BOX_STYLE] = tmp.Foreground(tcell.ColorBlue).Dim(true) ui.style[HEAD_STYLE] = tmp.Foreground(tcell.ColorBlue).Dim(true) - case FUZZ_MODE: - ui.style[BOX_STYLE] = tmp.Foreground(tcell.ColorPurple) - ui.style[HEAD_STYLE] = tmp.Foreground(tcell.ColorPurple) } } @@ -539,18 +536,6 @@ func i_prompt_insert(ui HardUI, curr *ItemsNode) { ui.buff.cursor, ui.dim[H] - 1) } -func i_prompt_fuzz(ui HardUI) { - prompt := "Search: " - i_draw_text(ui.s, - 1, ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1, - ui.style[DEF_STYLE], prompt) - i_draw_text(ui.s, len(prompt) + 1, - ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1, - ui.style[DEF_STYLE].Bold(true), ui.buff.str()) - ui.s.ShowCursor(len(prompt) + 1 + - ui.buff.cursor, ui.dim[H] - 1) -} - func i_draw_remove_share(ui HardUI) { text := "Really remove this share?" @@ -867,7 +852,7 @@ func i_ui(data_dir string) { i_draw_host_panel(data.ui, data.opts.Icon, data.litems, &data) i_draw_info_panel(data.ui, data.opts.Perc, data.litems) i_draw_scrollhint(data.ui, data.litems) - if data.load_err != nil && len(data.load_err) > 0 { + if len(data.load_err) > 0 { data.ui.mode = ERROR_MODE } switch data.ui.mode { @@ -902,8 +887,6 @@ func i_ui(data_dir string) { i_prompt_insert(data.ui, data.litems.curr) case HELP_MODE: i_draw_help(&data.ui) - case FUZZ_MODE: - i_prompt_fuzz(data.ui) } if len(data.ui.match_buff) > 0 { i_draw_match_buff(data.ui) |