about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py5
-rw-r--r--ranger/defaults/apps.py5
2 files changed, 5 insertions, 5 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 9f7321be..b382a684 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -222,6 +222,11 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		mode is a positive integer.
 		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)
+			raise SystemExit()
+
 		if isinstance(files, set):
 			files = list(files)
 		elif type(files) not in (list, tuple):
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index f889387d..2579f882 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -55,11 +55,6 @@ class CustomApplications(Applications):
 		"""How to determine the default application?"""
 		f = c.file
 
-		# ranger can act as a file chooser when running with --choosefile=...
-		if ranger.arg.choosefile:
-			open(ranger.arg.choosefile, 'w').write(f.path)
-			raise SystemExit()
-
 		if f.basename.lower() == 'makefile':
 			return self.either(c, 'make')