From 4069daa789c5235b94067ed88dc69a75d8545df7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Thu, 7 May 2015 17:55:22 +0200 Subject: core.fm: sxiv now properly working with :flat enabled --- ranger/core/fm.py | 8 ++++---- 1 file 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, -- cgit 1.4.1-2-gfad0