summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-26 22:47:27 +0200
committerhut <hut@lavabit.com>2010-05-26 22:47:27 +0200
commitd383965f431ee738a6db2da35d4092dfb108b739 (patch)
tree377f788c3f0e543462bdf00ca70a7095745770b9
parentb4f7187f0e05495c2cf902a367f14002d5e50821 (diff)
downloadranger-d383965f431ee738a6db2da35d4092dfb108b739.tar.gz
defaults.apps: simplify code for feh
-rw-r--r--ranger/defaults/apps.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index 97498a3e..cd745ff8 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -137,22 +137,10 @@ class CustomApplications(Applications):
 
 		c.flags += 'd'
 
-		if c.mode in arg:
+		if c.mode in arg: # mode 1, 2 and 3 will set the image as the background
 			return tup('feh', arg[c.mode], c.file.path)
-		if c.mode is 11:
-			if len(c.files) > 1:
-				return tup('feh', *c)
-			else:
-				from collections import deque
-
-				# Open all image files in feh
-				directory = self.fm.env.get_directory(c.file.dirname)
-				images = [f.path for f in directory.files if f.image]
-				position = images.index(c.file.path)
-				deq = deque(images)
-				deq.rotate(-position)
-
-				return tup('feh', *deq)
+		if c.mode is 11 and len(c.files) is 1: # view all files in the cwd
+			return tup('feh', self.fm.env.cwd.path, '--start-at', *c)
 		return tup('feh', *c)
 
 	@depends_on('aunpack')