diff options
-rw-r--r-- | ranger/ext/direction.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ranger/ext/direction.py b/ranger/ext/direction.py index 0b3f55f7..f96ee90f 100644 --- a/ranger/ext/direction.py +++ b/ranger/ext/direction.py @@ -133,3 +133,10 @@ class Direction(dict): else: pos += current return int(max(min(pos, maximum + offset - 1), minimum)) + + def select(self, lst, override, current, pagesize): + destination = self.move(direction=self.down(), override=override, + current=current, pagesize=pagesize, minimum=0, maximum=len(lst)) + if destination > current: + return destination, lst[current:destination] + return destination, lst[destination:current] |