summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-11-23 12:58:34 +0100
committerhut <hut@lavabit.com>2011-11-23 12:59:23 +0100
commit2b02078dc0ec9e939e1db3cbbe5f1d3bf4490846 (patch)
tree086d918886f22b43ec38627cb7de6efa6cdb6800
parente854efe9b2bf955b55b9e4175e67035742c01e2d (diff)
downloadranger-2b02078dc0ec9e939e1db3cbbe5f1d3bf4490846.tar.gz
core.actions: only choosefile when pressing l/enter
-rw-r--r--ranger/core/actions.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index dbfba502..1fe99ada 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -285,15 +285,16 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		Both flags and mode specify how the program is run."""
 
 		# ranger can act as a file chooser when running with --choosefile=...
-		if ranger.arg.choosefile:
-			open(ranger.arg.choosefile, 'w').write(self.fm.env.cf.path)
+		if ('mode' not in kw or kw['mode'] == 0) and 'app' not in kw:
+			if ranger.arg.choosefile:
+				open(ranger.arg.choosefile, 'w').write(self.fm.env.cf.path)
 
-		if ranger.arg.choosefiles:
-			open(ranger.arg.choosefiles, 'w').write("".join(
-				f.path + "\n" for f in self.fm.env.get_selection()))
+			if ranger.arg.choosefiles:
+				open(ranger.arg.choosefiles, 'w').write("".join(
+					f.path + "\n" for f in self.fm.env.get_selection()))
 
-		if ranger.arg.choosefile or ranger.arg.choosefiles:
-			raise SystemExit()
+			if ranger.arg.choosefile or ranger.arg.choosefiles:
+				raise SystemExit()
 
 		if isinstance(files, set):
 			files = list(files)