summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-07-19 02:09:24 +0200
committermathieui <mathieui@mathieui.net>2012-07-19 02:09:24 +0200
commit82e242305dba0e23069aeac7e65bb04aa9bb8556 (patch)
tree4b60310c97d035c93be3c78a29e38593cd2ed993 /src
parent0de6a197f645d7bac3163355cbb999a4ea0f1afc (diff)
downloadpoezio-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
Diffstat (limited to 'src')
-rw-r--r--src/windows.py47
1 files changed, 1 insertions, 46 deletions
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]()