From c5450bd180efd57f9cbd9d3315391b8cc8238be3 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 24 Feb 2010 15:35:16 +0100 Subject: console: fixed tabcompletion in openconsole starting with !xyz! --- TODO | 1 + ranger/gui/widgets/console.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 466ab8f4..d475f099 100644 --- a/TODO +++ b/TODO @@ -57,6 +57,7 @@ Bugs (X) #26 10/01/06 :delete on symlinks of directories fails (X) #31 10/01/06 ^C breaks cd-after-exit by stopping sourced shell script ( ) #40 10/01/17 freeze with unavailable sshfs + Looks like I need threads for that... (X) #41 10/01/17 capital file extensions are not recognized (X) #46 10/01/19 old username displayed after using su (X) #49 10/01/19 fix unit tests :'( diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index a496f6a9..5439b2a8 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -396,11 +396,20 @@ class OpenConsole(ConsoleWithTab): def _get_tab(self): try: - position_of_last_space = self.line.rindex(" ") + i = self.line.index('!')+1 except ValueError: - return (program + ' ' for program in self.fm.executables \ - if program.startswith(self.line)) - if position_of_last_space == len(self.line) - 1: + line = self.line + start = '' + else: + line = self.line[i:] + start = self.line[:i] + + try: + position_of_last_space = line.rindex(" ") + except ValueError: + return (start + program + ' ' for program in self.fm.executables \ + if program.startswith(line)) + if position_of_last_space == len(line) - 1: return self.line + '%s ' else: before_word, start_of_word = self.line.rsplit(' ', 1) -- cgit 1.4.1-2-gfad0 grix/lynx-snapshots/stats/docs/README.defines'>stats
path: root/docs/README.defines
blob: a8c0a2d127f54a848c1730b6a13e0e9402efc0c1 (plain) (tree)