summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 6bbb35aa..981df05b 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -483,9 +483,12 @@ 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):
+            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(