Fixed porting bug causing traceback.

Sat, 30 Jan 2010 15:47:10 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 30 Jan 2010 15:47:10 +0000
changeset 86
778f405e9411
parent 85
2d80c7a3e773
child 87
4cc5c8d1184d

Fixed porting bug causing traceback.

QScintilla/TypingCompleters/CompleterPython.py file | annotate | diff | comparison | revisions
--- 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):

eric ide

mercurial