summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-29 00:18:31 +0100
committermathieui <mathieui@mathieui.net>2011-11-29 00:18:31 +0100
commit1e8383c3e3ba717b45d69a978361bbae34f8fd39 (patch)
treec15c7d69f64cca7d2d46d25a121353bbbbc6206a /src
parentf92e875611c6f38cc1529c46869ac92a003d19a8 (diff)
downloadpoezio-1e8383c3e3ba717b45d69a978361bbae34f8fd39.tar.gz
poezio-1e8383c3e3ba717b45d69a978361bbae34f8fd39.tar.bz2
poezio-1e8383c3e3ba717b45d69a978361bbae34f8fd39.tar.xz
poezio-1e8383c3e3ba717b45d69a978361bbae34f8fd39.zip
Fix a traceback when using ^W with xhtml-im
(it does not work perfectly as it should, but it doesn’t crash anymore, at least)
Diffstat (limited to 'src')
-rw-r--r--src/windows.py4
1 files 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