about summary refs log tree commit diff stats
path: root/ranger/api/commands.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-05 04:08:38 +0100
committerhut <hut@lavabit.com>2013-02-05 04:08:38 +0100
commit5036975750fb3447f5a060bf1523773eb25d3313 (patch)
treedd273ecd9df97792defd5d118c5dde99b6a7124f /ranger/api/commands.py
parentaa6cc7a69c5eb9300f9f9ce31a04998be1dab0f1 (diff)
downloadranger-5036975750fb3447f5a060bf1523773eb25d3313.tar.gz
added tab completion for open_with
Diffstat (limited to 'ranger/api/commands.py')
-rw-r--r--ranger/api/commands.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index 8e7e16ac..4a9688a0 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -271,6 +271,17 @@ class Command(FileManagerAware):
 			# manually type in the slash to advance into that directory
 			return (self.start(1) + join(rel_dirname, name) for name in names)
 
+	def _tab_through_executables(self):
+		from ranger.ext.get_executables import get_executables
+		programs = [program for program in get_executables() if \
+				program.startswith(self.rest(1))]
+		if not programs:
+			return
+		if len(programs) == 1:
+			return self.start(1) + programs[0]
+		programs.sort()
+		return (self.start(1) + program for program in programs)
+
 
 class FunctionCommand(Command):
 	_based_function = None