diff options
-rw-r--r-- | ranger/config/rc.conf | 1 | ||||
-rw-r--r-- | ranger/core/actions.py | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 6b0802bb..1296f1ca 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -386,6 +386,7 @@ map L history_go 1 map ] move_parent 1 map [ move_parent -1 map } traverse +map { traverse_backwards map ) jump_non map gh cd ~ diff --git a/ranger/core/actions.py b/ranger/core/actions.py index e790aaa8..e8c47b9f 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -606,6 +606,23 @@ class Actions( # pylint: disable=too-many-instance-attributes,too-many-public-m self.move(down=1) self.traverse() + def traverse_backwards(self): + self.change_mode('normal') + if self.thisdir.pointer == 0: + self.move(left=1) + if self.thisdir.pointer != 0: + self.traverse_backwards() + else: + self.move(up=1) + while True: + if self.thisfile is not None and self.thisfile.is_directory: + self.enter_dir(self.thisfile.path) + self.move(to=100, percentage=True) + elif self.thisdir.pointer == 0: + break + else: + self.move(up=1) + # -------------------------- # -- Shortcuts / Wrappers # -------------------------- |