diff options
author | mathieui <mathieui@mathieui.net> | 2012-07-19 02:09:24 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-07-19 02:09:24 +0200 |
commit | 82e242305dba0e23069aeac7e65bb04aa9bb8556 (patch) | |
tree | 4b60310c97d035c93be3c78a29e38593cd2ed993 | |
parent | 0de6a197f645d7bac3163355cbb999a4ea0f1afc (diff) | |
download | poezio-82e242305dba0e23069aeac7e65bb04aa9bb8556.tar.gz poezio-82e242305dba0e23069aeac7e65bb04aa9bb8556.tar.bz2 poezio-82e242305dba0e23069aeac7e65bb04aa9bb8556.tar.xz poezio-82e242305dba0e23069aeac7e65bb04aa9bb8556.zip |
Remove the shell_completion
- completion is normal with no way to change it
(shell_completion was buggy)
- remove it in the default config and in the doc too
-rw-r--r-- | data/default_config.cfg | 7 | ||||
-rw-r--r-- | doc/en/configure.txt | 9 | ||||
-rw-r--r-- | src/windows.py | 47 |
3 files changed, 1 insertions, 62 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg index d1cfdf1b..252ea063 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -84,13 +84,6 @@ use_bookmarks_method = use_remote_bookmarks = true -# the completion type you will use to complete nicknames -# if "normal", complete the entire name to the first available completion -# and then cycle through the possible completion with the next TABs -# if "shell", if there's more than one nick for this completion, complete -# only the part that all then nicks have in common (like in a shell) -completion = normal - # what will be put after the name, when using autocompletion # a SPACE will always be added after that after_completion = , diff --git a/doc/en/configure.txt b/doc/en/configure.txt index 901ff9eb..0fdaeb30 100644 --- a/doc/en/configure.txt +++ b/doc/en/configure.txt @@ -118,15 +118,6 @@ section of this documentation. use this option to force the use of local bookmarks if needed. Anything but "false" will be counted as true. -*completion*:: normal - - the completion type you will use to complete nicknames - if "normal", complete the entire name to the first available completion - and then cycle through the possible completion with the next TABs - if "shell", if there's more than one nick for this completion, complete - only the part that all then nicks have in common (like in a shell) - - *after_completion*:: , what will be put after the name, when using autocompletion diff --git a/src/windows.py b/src/windows.py index 21f5125c..03905d4b 100644 --- a/src/windows.py +++ b/src/windows.py @@ -1173,14 +1173,10 @@ class Input(Win): plus a space, after the completion. If it's a string, we use it after the completion (with no additional space) """ - completion_type = config.get('completion', 'normal') if quotify: for i, word in enumerate(word_list[:]): word_list[i] = '"' + word + '"' - if completion_type == 'shell' and self.text != '': - self.shell_completion(word_list, add_after) - else: - self.normal_completion(word_list, add_after) + self.normal_completion(word_list, add_after) return True def reset_completion(self): @@ -1234,47 +1230,6 @@ class Input(Win): self.rewrite_text() self.last_completion = hit - def shell_completion(self, word_list, after): - """ - Shell-like completion - """ - (y, x) = self._win.getyx() - if self.text != '': - begin = self.text.split()[-1].lower() - else: - begin = '' - hit_list = [] # list of matching nicks - for user in word_list: - if user.lower().startswith(begin): - hit_list.append(user) - if len(hit_list) == 0: - return - end = False - nick = '' - last_completion = self.last_completion - self.last_completion = True - if len(hit_list) == 1: - nick = hit_list[0] + after - self.last_completion = False - elif last_completion: - for n in hit_list: - if begin.lower() == n.lower(): - nick = n+after # user DO want this completion (tabbed twice on it) - self.last_completion = False - if nick == '': - while not end and len(nick) < len(hit_list[0]): - nick = hit_list[0][:len(nick)+1] - for hit in hit_list: - if not hit.lower().startswith(nick.lower()): - end = True - break - if end: - nick = nick[:-1] - x -= len(begin) - self.text = self.text[:-len(begin)] - self.text += nick - self.key_end(False) - def do_command(self, key, reset=True, raw=False): if key in self.key_func: res = self.key_func[key]() |