summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-23 02:48:02 +0100
committerhut <hut@lavabit.com>2010-01-23 02:48:02 +0100
commit07fd28a287604d4b2f0c6b697b72fa21abb93318 (patch)
treebfa642a310b07a46134134e3adbfb6aa6c6abe86
parent8e1de9174e18bf804bde3186a3a893698fcf7f78 (diff)
downloadranger-07fd28a287604d4b2f0c6b697b72fa21abb93318.tar.gz
console: tab completion for OpenConsole
-rw-r--r--ranger/gui/widgets/console.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 29e8f1c5..b3e49c47 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -389,10 +389,14 @@ class OpenConsole(ConsoleWithTab):
 
 	def _get_tab(self):
 		# for now, just add " %s"
-		result = self.line
-		if result and result[-1] != ' ':
-			result += ' '
-		return result + '%s '
+		if ' ' in self.line:
+			result = self.line
+			if result and result[-1] != ' ':
+				result += ' '
+			return result + '%s '
+		else:
+			return (program + ' ' for program in self.fm.executables \
+					if program.startswith(self.line))
 
 	def _substitute_metachars(self, command):
 		dct = {}