summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2018-08-19 16:04:01 +0200
committerGitHub <noreply@github.com>2018-08-19 16:04:01 +0200
commitf4a7ff4d096e0c6283b2c142da6d1806a1fd1615 (patch)
tree8c2954925f4a83d588704aaf4daed78e51f3d208
parent478a3538d2f38fa4066814b7b4f72cb768f3a361 (diff)
parent67df2a7d299402306a00a3303f463138abc56734 (diff)
downloadranger-f4a7ff4d096e0c6283b2c142da6d1806a1fd1615.tar.gz
Merge pull request #1178 from toonn/rangerpath
Actually check whether selection is a directory for rangerpath patch
-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 f8364250..86927a6e 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -490,10 +490,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(),