summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-01-20 01:01:29 +0100
committerhut <hut@lavabit.com>2010-01-20 01:44:04 +0100
commitba3c477b4144943ceb1bd07cf316828e9e742a4d (patch)
treef7980e1d8467e4464c6551ebebf26f03594c0ad5
parent7bbb18168d9ad8d5783621bdf1bb8516d14627e4 (diff)
downloadranger-ba3c477b4144943ceb1bd07cf316828e9e742a4d.tar.gz
console: slightly improved tab completion for CommandConsole
-rw-r--r--ranger/gui/widgets/console.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index 5c888da5..6562276f 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -386,7 +386,10 @@ class OpenConsole(ConsoleWithTab):
 
 	def _get_tab(self):
 		# for now, just add " %s"
-		return self.line + ' %s'
+		result = self.line
+		if result and result[-1] != ' ':
+			result += ' '
+		return result + '%s '
 
 	def _substitute_metachars(self, command):
 		dct = {}