From 05928d592f76c7948a19981454d763feee51b2fb Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Sat, 7 Aug 2010 19:18:36 +0000 Subject: completion is now sorted by last_talked. fixed #1712 --- src/window.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/window.py') 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): -- cgit v1.2.3