diff options
author | hut <hut@lepus.uberspace.de> | 2015-01-04 07:22:07 +0100 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2015-01-04 07:22:07 +0100 |
commit | 564ff12c4344f4f88c3ee466b1d5b1f15c071ff5 (patch) | |
tree | 2396abf49cd222fff3b67beeb9974a585ba3bc70 /ranger | |
parent | 27a24a098f912e960c8ea2043ac34bfd58b618bf (diff) | |
parent | 2e8a1516f3c9295cafe50f748078ace5685d8342 (diff) | |
download | ranger-564ff12c4344f4f88c3ee466b1d5b1f15c071ff5.tar.gz |
Merge branch 'move-cycle' of https://github.com/PotatoesMaster/ranger
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/ext/direction.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ranger/ext/direction.py b/ranger/ext/direction.py index 4b20ea0d..bd00fa6b 100644 --- a/ranger/ext/direction.py +++ b/ranger/ext/direction.py @@ -81,6 +81,9 @@ class Direction(dict): def percentage(self): return 'percentage' in self and self['percentage'] + def cycle(self): + return self.get('cycle') + def multiply(self, n): for key in ('up', 'right', 'down', 'left'): try: @@ -126,6 +129,8 @@ class Direction(dict): pos += maximum else: pos += current + if self.cycle(): + return minimum + pos % (maximum + offset - minimum) return int(max(min(pos, maximum + offset - 1), minimum)) def select(self, lst, current, pagesize, override=None, offset=1): |