summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorToon Nolten <toon.nolten@student.kuleuven.be>2018-05-16 15:39:59 +0200
committerToon Nolten <toon.nolten@student.kuleuven.be>2018-05-16 20:52:54 +0200
commitcd4b2df4304071ea1fc1f035058700433a8b1c4a (patch)
treec851fb0b150cd20af44e24e2d98660ace3f1fa18
parent3c430ba0f1b3fe2e17225788866f37bcd1f85c3b (diff)
downloadranger-cd4b2df4304071ea1fc1f035058700433a8b1c4a.tar.gz
Actually check whether selection is a directory
`Actions.move()` used `enter_dir()` to determine whether the selection
was a directory. Now we explicitly check whether it's a directory.

Fixes #1177
-rw-r--r--ranger/core/actions.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 6bbb35aa..6ddcdd86 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -483,10 +483,13 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
                 mode = narg
             tfile = self.thisfile
             selection = self.thistab.get_selection()
-            if not self.thistab.enter_dir(tfile) and selection:
-                result = self.execute_file(selection, mode=mode)
-                if result in (False, ASK_COMMAND):
-                    self.open_console('open_with ')
+            if selection:
+                if selection.is_directory:
+                    self.thistab.enter_dir(tfile)
+                else:
+                    result = self.execute_file(selection, mode=mode)
+                    if result in (False, ASK_COMMAND):
+                        self.open_console('open_with ')
         elif direction.vertical() and cwd.files:
             pos_new = direction.move(
                 direction=direction.down(),