diff -r 2d80c7a3e773 -r 778f405e9411 QScintilla/TypingCompleters/CompleterPython.py --- a/QScintilla/TypingCompleters/CompleterPython.py Sat Jan 30 10:38:46 2010 +0000 +++ b/QScintilla/TypingCompleters/CompleterPython.py Sat Jan 30 15:47:10 2010 +0000 @@ -176,12 +176,13 @@ # colon # skip colon, dedent to if for else: elif char == ':': - if char == self.editor.text(line)[col]: + text = self.editor.text(line) + if col < len(text) and char == txt[col]: if self.__colonDetection: self.editor.setSelection(line, col, line, col + 1) self.editor.removeSelectedText() else: - txt = self.editor.text(line)[:col] + txt = text[:col] if self.__dedentElse and self.__elseRX.exactMatch(txt): self.__dedentElseToIfWhileForTry() elif self.__dedentExcept and self.__exceptcRX.exactMatch(txt):