aboutsummaryrefslogtreecommitdiffstats
path: root/c_litems.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-15 20:20:20 +0100
commitb29a8b31df90e2c7bde6542fe29bc0d8869007a9 (patch)
tree08120c56dfc7e93d2511cfb90e616331bbe1cdef /c_litems.go
parentok (diff)
downloadhardflip-b29a8b31df90e2c7bde6542fe29bc0d8869007a9.tar.gz
hardflip-b29a8b31df90e2c7bde6542fe29bc0d8869007a9.tar.bz2
hardflip-b29a8b31df90e2c7bde6542fe29bc0d8869007a9.tar.xz
hardflip-b29a8b31df90e2c7bde6542fe29bc0d8869007a9.tar.zst
hardflip-b29a8b31df90e2c7bde6542fe29bc0d8869007a9.zip
ok
Diffstat (limited to '')
-rw-r--r--c_litems.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/c_litems.go b/c_litems.go
index b7b1b4b..4aa21d6 100644
--- a/c_litems.go
+++ b/c_litems.go
@@ -167,6 +167,26 @@ func (litems *ItemsList) inc(jump int) {
litems.curr = new_item
}
+// returns the previous dir
+func (item *ItemsNode) prev_dir() *ItemsNode {
+ for ptr := item.prev; ptr != nil && ptr.prev != nil; ptr = ptr.prev {
+ if ptr.is_dir() == true {
+ return ptr
+ }
+ }
+ return nil
+}
+
+// returns the next dir
+func (item *ItemsNode) next_dir() *ItemsNode {
+ for ptr := item.next; ptr != nil && ptr.next != nil; ptr = ptr.next {
+ if ptr.is_dir() == true {
+ return ptr
+ }
+ }
+ return nil
+}
+
// returns the next directory in line with the same or lower depth
func (item *ItemsNode) get_next_level() *ItemsNode {
if item == nil || item.Dirs == nil {
@@ -190,4 +210,3 @@ func (item *ItemsNode) get_next_level() *ItemsNode {
}
return nil
}
-