summaryrefslogtreecommitdiff
path: root/src/window.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-08-07 19:18:36 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-08-07 19:18:36 +0000
commit05928d592f76c7948a19981454d763feee51b2fb (patch)
tree8cd049bbc0d987fee219f51aa258be924274baab /src/window.py
parenteb36e08e11e8acac2db6a0422b5c9bd5ec9ab395 (diff)
downloadpoezio-05928d592f76c7948a19981454d763feee51b2fb.tar.gz
poezio-05928d592f76c7948a19981454d763feee51b2fb.tar.bz2
poezio-05928d592f76c7948a19981454d763feee51b2fb.tar.xz
poezio-05928d592f76c7948a19981454d763feee51b2fb.zip
completion is now sorted by last_talked. fixed #1712
Diffstat (limited to 'src/window.py')
-rw-r--r--src/window.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/window.py b/src/window.py
index a0b58cfd..2c030afe 100644
--- a/src/window.py
+++ b/src/window.py
@@ -541,10 +541,10 @@ class Input(Win):
"""
Complete the nickname
"""
- if self.pos+self.line_pos != len(self.text) or len(self.text) == 0:
+ if self.pos+self.line_pos != len(self.text): # or len(self.text) == 0
return # we don't complete if cursor is not at the end of line
completion_type = config.get('completion', 'normal')
- if completion_type == 'shell':
+ if completion_type == 'shell' and self.text != '':
self.shell_completion(user_list)
else:
self.normal_completion(user_list)
@@ -567,7 +567,10 @@ class Input(Win):
(y, x) = self.win.getyx()
if not self.last_key_tab:
# begin is the begining of the nick we want to complete
- begin = self.text.split()[-1].encode('utf-8').lower()
+ if self.text != '':
+ begin = self.text.split()[-1].encode('utf-8').lower()
+ else:
+ begin = ''
hit_list = [] # list of matching nicks
for user in user_list:
if user.lower().startswith(begin):
@@ -595,7 +598,10 @@ class Input(Win):
else:
after = config.get('after_completion', ',')+" "
(y, x) = self.win.getyx()
- begin = self.text.split()[-1].encode('utf-8').lower()
+ if self.text != '':
+ begin = self.text.split()[-1].encode('utf-8').lower()
+ else:
+ begin = ''
hit_list = [] # list of matching nicks
for user in user_list:
if user.lower().startswith(begin):