aboutsummaryrefslogtreecommitdiffstats
path: root/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-10 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-10 20:20:20 +0100
commit1547035da000d94ca0fa9b794ddaa651952c1b97 (patch)
treeb0367ddad71e2cb18d24578e37f44f18db3b59d4 /i_events.go
parenttmp (diff)
downloadhardflip-1547035da000d94ca0fa9b794ddaa651952c1b97.tar.gz
hardflip-1547035da000d94ca0fa9b794ddaa651952c1b97.tar.bz2
hardflip-1547035da000d94ca0fa9b794ddaa651952c1b97.tar.xz
hardflip-1547035da000d94ca0fa9b794ddaa651952c1b97.tar.zst
hardflip-1547035da000d94ca0fa9b794ddaa651952c1b97.zip
kinda works i guess
Diffstat (limited to 'i_events.go')
-rw-r--r--i_events.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/i_events.go b/i_events.go
index 8cf9a82..e9f50bb 100644
--- a/i_events.go
+++ b/i_events.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_events.go
- * Wed Jan 10 11:30:31 2024
+ * Wed Jan 10 12:04:16 2024
* Joe
*
* events in the code
@@ -93,14 +93,29 @@ func i_list_follow_cursor(litems *ItemsList, ui *HardUI) {
}
func i_fold_dir(data *HardData, item *ItemsNode) {
- litems := data.litems
+ if item == nil {
+ return
+ }
+ // litems := data.litems
folds := data.folds
-
- folds[item] = &ItemsList{
- nil,
+ folded_start := item.next
+ folded_start.prev = nil
+ folded_end := item
+ for i := 0; i < item.Dirs.count_elements() && folded_end != nil; i++ {
+ folded_end = folded_end.next
+ }
+ after := folded_end.next
+ folded_end.next = nil
+ tmp := ItemsList{
+ folded_start,
+ folded_end,
nil,
nil,
}
+ item.next = after
+ after.prev = item
+
+ folds[item] = &tmp
}
func i_reload_data(data *HardData) {