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
This commit is contained in:
parent
0de6a197f6
commit
82e242305d
3 changed files with 1 additions and 62 deletions
|
@ -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 = ,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]()
|
||||
|
|
Loading…
Reference in a new issue