diff options
author | mathieui <mathieui@mathieui.net> | 2011-11-29 00:18:31 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-01-26 10:05:32 +0100 |
commit | 8eea23f7d75aa688243501f62446547324ebc2c8 (patch) | |
tree | c15c7d69f64cca7d2d46d25a121353bbbbc6206a /src | |
parent | 4d7a11e23868c2c8dbeddc9c3dcb9c3d84ec0101 (diff) | |
download | poezio-8eea23f7d75aa688243501f62446547324ebc2c8.tar.gz poezio-8eea23f7d75aa688243501f62446547324ebc2c8.tar.bz2 poezio-8eea23f7d75aa688243501f62446547324ebc2c8.tar.xz poezio-8eea23f7d75aa688243501f62446547324ebc2c8.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.py | 4 |
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 |