aboutsummaryrefslogtreecommitdiffstats
path: root/c_litems.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-09 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-09 20:20:20 +0100
commit3712c434b7ed9f64a156db8f459082051e8abd75 (patch)
tree29043e0a962a1441195629338c5b9f8e06e57d26 /c_litems.go
parentadded rdp port handling (diff)
downloadhardflip-3712c434b7ed9f64a156db8f459082051e8abd75.tar.gz
hardflip-3712c434b7ed9f64a156db8f459082051e8abd75.tar.bz2
hardflip-3712c434b7ed9f64a156db8f459082051e8abd75.tar.xz
hardflip-3712c434b7ed9f64a156db8f459082051e8abd75.tar.zst
hardflip-3712c434b7ed9f64a156db8f459082051e8abd75.zip
fix
Diffstat (limited to 'c_litems.go')
-rw-r--r--c_litems.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/c_litems.go b/c_litems.go
index 6b64e8c..5640b5e 100644
--- a/c_litems.go
+++ b/c_litems.go
@@ -167,14 +167,18 @@ func (litems *ItemsList) inc(jump int) {
new_item = new_item.prev
}
}
- for new_item.folded_parents() == true &&
- new_item.next != nil &&
+ for jump > 0 &&
+ new_item.folded_parents() == true &&
+ new_item.next != nil {
+ new_item = new_item.next
+ }
+ for jump < 0 &&
+ new_item.folded_parents() == true &&
new_item.prev != nil {
- if jump > 0 {
- new_item = new_item.next
- } else {
- new_item = new_item.prev
- }
+ new_item = new_item.prev
+ }
+ if new_item == litems.last && new_item.folded_parents() == true {
+ return
}
litems.curr = new_item
// FIX: still will select the last