From a3c8c7890014a79689566737418cb111185907ac Mon Sep 17 00:00:00 2001 From: Toon Nolten Date: Mon, 20 Aug 2018 22:41:13 +0200 Subject: Check whether tfile is a dir not the entire selection Was erroneously checking the entire selection for being *a* directory but a list of 1 or more files/directories is obviously not a directory. Fixes #1269 --- ranger/core/actions.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 6ddcdd86..443520b1 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -483,13 +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 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 ') + if tfile.is_directory: + self.thistab.enter_dir(tfile) + elif selection: + 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(), -- cgit 1.4.1-2-gfad0