summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2015-05-07 17:55:22 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2015-05-07 17:55:22 +0200
commit4069daa789c5235b94067ed88dc69a75d8545df7 (patch)
tree6d4234161420847c78f485f6deeff62d643f6805
parent4d6cbc530a44536481b01c4183d876d3c8308ef9 (diff)
downloadranger-4069daa789c5235b94067ed88dc69a75d8545df7.tar.gz
core.fm: sxiv now properly working with :flat enabled
-rw-r--r--ranger/core/fm.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/core/fm.py b/ranger/core/fm.py
index 6c9513c3..0313639a 100644
--- a/ranger/core/fm.py
+++ b/ranger/core/fm.py
@@ -138,23 +138,23 @@ class FM(Actions, SignalDispatcher):
                     len(self.thisdir.marked_items) == 0 and \
                     re.match(r'^(feh|sxiv) ', command):
 
-                images = [f.basename for f in self.thisdir.files if f.image]
+                images = [f.relative_path for f in self.thisdir.files if f.image]
                 escaped_filenames = " ".join(shell_quote(f) \
                         for f in images if "\x00" not in f)
 
-                if images and self.thisfile.basename in images and \
+                if images and self.thisfile.relative_path in images and \
                         "$@" in command:
                     new_command = None
 
                     if command[0:5] == 'sxiv ':
-                        number = images.index(self.thisfile.basename) + 1
+                        number = images.index(self.thisfile.relative_path) + 1
                         new_command = command.replace("sxiv ",
                                 "sxiv -n %d " % number, 1)
 
                     if command[0:4] == 'feh ':
                         new_command = command.replace("feh ",
                             "feh --start-at %s " % \
-                            shell_quote(self.thisfile.basename), 1)
+                            shell_quote(self.thisfile.relative_path), 1)
 
                     if new_command:
                         command = "set -- %s; %s" % (escaped_filenames,