Skip to content

Commit

Permalink
open_all_images support for imv
Browse files Browse the repository at this point in the history
  • Loading branch information
autrimpo committed Nov 13, 2015
1 parent 946ff7e commit a9f6a0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ranger/core/fm.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def sxiv_workaround_hook(command):

if self.settings.open_all_images and \
len(self.thisdir.marked_items) == 0 and \
re.match(r'^(feh|sxiv) ', command):
re.match(r'^(feh|sxiv|imv) ', command):

images = [f.relative_path for f in self.thisdir.files if f.image]
escaped_filenames = " ".join(shell_quote(f) \
Expand All @@ -156,6 +156,11 @@ def sxiv_workaround_hook(command):
"feh --start-at %s " % \
shell_quote(self.thisfile.relative_path), 1)

if command[0:4] == 'imv ':
number = images.index(self.thisfile.relative_path) + 1
new_command = command.replace("imv ",
"imv -n %d " % number, 1)

if new_command:
command = "set -- %s; %s" % (escaped_filenames,
new_command)
Expand Down

0 comments on commit a9f6a0d

Please sign in to comment.