From 6f866cf8feb9d5c7707e337c6edb2335c1fa16d8 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 9 Jan 2024 20:20:20 +0100 Subject: folding visually --- i_events.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'i_events.go') diff --git a/i_events.go b/i_events.go index 4ea2a1a..9989d2a 100644 --- a/i_events.go +++ b/i_events.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_events.go - * Mon Jan 08 16:40:17 2024 + * Tue Jan 09 12:00:50 2024 * Joe * * events in the code @@ -146,8 +146,9 @@ func i_events(data *HardData) { ui.sel_max != 0 { ui.mode = DELETE_MODE } else if event.Key() == tcell.KeyEnter { - if data.litems.curr != nil && - data.litems.curr.is_dir() == false { + if data.litems.curr == nil { + return + } else if data.litems.curr.is_dir() == false { ui.s.Fini() c_exec(data.litems.curr.Host) if data.opts.Loop == false { @@ -161,6 +162,12 @@ func i_events(data *HardData) { } ui.s.SetStyle(ui.def_style) } + } else { + if data.litems.curr.Dirs.Folded == false { + data.litems.curr.Dirs.Folded = true + } else { + data.litems.curr.Dirs.Folded = false + } } } if event.Key() == tcell.KeyCtrlR { -- cgit v1.2.3