From 1e8383c3e3ba717b45d69a978361bbae34f8fd39 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 29 Nov 2011 00:18:31 +0100 Subject: =?UTF-8?q?Fix=20a=20traceback=20when=20using=20^W=20with=20xhtml-?= =?UTF-8?q?im=20(it=20does=20not=20work=20perfectly=20as=20it=20should,=20?= =?UTF-8?q?but=20it=20doesn=E2=80=99t=20crash=20anymore,=20at=20least)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/windows.py b/src/windows.py index 80a8bbb1..f2ffc8a7 100644 --- a/src/windows.py +++ b/src/windows.py @@ -852,9 +852,9 @@ class Input(Win): if not len(self.text) or self.pos == 0: return separators = string.punctuation+' ' - while self.pos > 0 and self.text[self.pos+self.line_pos-1] in separators: + while self.pos <= len(self.text) and self.pos > 0 and self.text[self.pos+self.line_pos-1] in separators: self.key_backspace() - while self.pos > 0 and self.text[self.pos+self.line_pos-1] not in separators: + while self.pos <= len(self.text) and self.pos > 0 and self.text[self.pos+self.line_pos-1] not in separators: self.key_backspace() return True -- cgit v1.2.3