diff options
author | hut <hut@lavabit.com> | 2010-01-23 02:48:02 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-23 02:48:02 +0100 |
commit | 07fd28a287604d4b2f0c6b697b72fa21abb93318 (patch) | |
tree | bfa642a310b07a46134134e3adbfb6aa6c6abe86 /ranger | |
parent | 8e1de9174e18bf804bde3186a3a893698fcf7f78 (diff) | |
download | ranger-07fd28a287604d4b2f0c6b697b72fa21abb93318.tar.gz |
console: tab completion for OpenConsole
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/widgets/console.py | 12 |
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 = {} |