diff options
author | Joe <rbo@gmx.us> | 2024-02-20 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-02-20 20:20:20 +0100 |
commit | 8fcad97e2eea916323d30be1f60986d83b2fb9c1 (patch) | |
tree | fb47407df45f2cfe82551c02335a7c21f4791e5f | |
parent | rdp_file (diff) | |
download | hardflip-8fcad97e2eea916323d30be1f60986d83b2fb9c1.tar.gz hardflip-8fcad97e2eea916323d30be1f60986d83b2fb9c1.tar.bz2 hardflip-8fcad97e2eea916323d30be1f60986d83b2fb9c1.tar.xz hardflip-8fcad97e2eea916323d30be1f60986d83b2fb9c1.tar.zst hardflip-8fcad97e2eea916323d30be1f60986d83b2fb9c1.zip |
cool
-rw-r--r-- | src/i_events.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/i_events.go b/src/i_events.go index 7b4f38c..64260f1 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -340,7 +340,49 @@ func i_events(data *HardData) { data.litems.head != nil && data.litems.curr != nil { ui.mode = DELETE_MODE + } else if event.Rune() == 'H' { + for curr := data.ldirs.head; curr != nil; curr = curr.next { + if data.folds[curr] == nil { + i_fold_dir(data, curr) + } + } + } else if event.Rune() == 'h' || + event.Key() == tcell.KeyLeft { + for curr := data.litems.curr; + curr != nil; + curr = curr.prev { + if curr.is_dir() == true { + if data.folds[curr.Dirs] == nil { + i_fold_dir(data, curr) + data.litems.curr = curr + break + } else { + if data.folds[curr.Dirs.Parent] == nil { + parent := curr.Dirs.Parent + for curr_new := curr; + curr_new != nil; + curr_new = curr_new.prev { + if curr_new.is_dir() == true { + if curr_new.Dirs == parent { + i_fold_dir(data, curr_new) + data.litems.curr = curr_new + break + // TODO: here + } else { + if data.folds[curr_new.Dirs] == + nil { + i_fold_dir(data, curr_new) + } + } + } + } + } + break + } + } + } } else if event.Rune() == 'l' || + event.Key() == tcell.KeyRight || event.Key() == tcell.KeyEnter { if data.litems.curr == nil { break |