From 5cc32e394d8dabac0d5e349b301b78b8f31b94de Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 27 Jan 2011 22:42:59 -0700 Subject: [PATCH] Fix completion on a word with a trailing space causing the first letter to be duplicated --- src/calibre/gui2/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index afbe6b5d8c..68e78cb6a6 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -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