Fix completion on a word with a trailing space causing the first letter to be duplicated

This commit is contained in:
Kovid Goyal 2011-01-27 22:42:59 -07:00
parent 05cf89a1f0
commit 5cc32e394d

View File

@ -503,7 +503,7 @@ class CompleteLineEdit(EnLineEdit):
cursor_pos = self.cursorPosition()
before_text = unicode(self.text())[:cursor_pos]
after_text = unicode(self.text())[cursor_pos:]
prefix_len = len(before_text.split(self.separator)[-1].strip())
prefix_len = len(before_text.split(self.separator)[-1].lstrip())
if self.space_before_sep:
complete_text_pat = '%s%s %s %s'
len_extra = 3