From affcb1491f9191ff116c20348e06e3f22e9f22a8 Mon Sep 17 00:00:00 2001 From: Orakaro Date: Sun, 8 Jun 2014 23:34:00 +0900 Subject: [PATCH] fix autocomplete --- rainbowstream/interactive.py | 11 ++++++----- rainbowstream/rainbow.py | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/rainbowstream/interactive.py b/rainbowstream/interactive.py index 47a2576..98b9c21 100644 --- a/rainbowstream/interactive.py +++ b/rainbowstream/interactive.py @@ -1,5 +1,4 @@ import readline -import rlcompleter import os.path from .config import * @@ -33,6 +32,8 @@ class RainbowCompleter(object): try: if begin == 0: candidates = self.options.keys() + elif words[-1] in self.options[words[0]]: + candidates = [] else: first = words[0] candidates = self.options[first] @@ -43,7 +44,7 @@ class RainbowCompleter(object): else: self.current_candidates = candidates - except (KeyError, IndexError), err: + except (KeyError, IndexError): self.current_candidates = [] try: @@ -84,9 +85,9 @@ def init_interactive_shell(d): """ readline.set_completer(RainbowCompleter(d).complete) readline.parse_and_bind('set editing-mode vi') - readline.parse_and_bind("set input-meta on") - readline.parse_and_bind("set convert-meta off") - readline.parse_and_bind("set output-meta on") + readline.parse_and_bind('set show-all-if-ambiguous on') + readline.parse_and_bind('set show-all-if-unmodified on') + readline.parse_and_bind('set skip-completed-text on') if 'libedit' in readline.__doc__: readline.parse_and_bind("bind ^I rl_complete") else: diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index 888b261..754b129 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -599,7 +599,7 @@ def listen(): d = dict(zip( cmdset, [ - ['public #', 'mine'], # switch + ['public', 'mine'], # switch [], # home ['@'], # view [], # tweet @@ -610,8 +610,8 @@ def listen(): [], # unfavorite ['#'], # search ['image'], # show image - [], # follow - [], # unfollow + ['@'], # follow + ['@'], # unfollow [], # help [], # clear [], # quit -- 2.25.1