Fixed an issue in the typing completers causing a stacktrace. 5_0_x

Thu, 29 Jul 2010 18:34:43 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 29 Jul 2010 18:34:43 +0200
branch
5_0_x
changeset 430
0b4a8e85a043
parent 423
3414c60a2a47
child 434
3a2b62a5db7a

Fixed an issue in the typing completers causing a stacktrace.

QScintilla/TypingCompleters/CompleterPython.py file | annotate | diff | comparison | revisions
QScintilla/TypingCompleters/CompleterRuby.py file | annotate | diff | comparison | revisions
--- a/QScintilla/TypingCompleters/CompleterPython.py	Tue Jul 27 19:53:51 2010 +0200
+++ b/QScintilla/TypingCompleters/CompleterPython.py	Thu Jul 29 18:34:43 2010 +0200
@@ -123,7 +123,8 @@
         # closing parenthesis
         # skip matching closing parenthesis
         elif char in [')', '}', ']']:
-            if char == self.editor.text(line)[col]:
+            txt = self.editor.text(line)
+            if col < len(txt) and char == txt[col]:
                 if self.__skipBrace:
                     self.editor.setSelection(line, col, line, col + 1)
                     self.editor.removeSelectedText()
--- a/QScintilla/TypingCompleters/CompleterRuby.py	Tue Jul 27 19:53:51 2010 +0200
+++ b/QScintilla/TypingCompleters/CompleterRuby.py	Thu Jul 29 18:34:43 2010 +0200
@@ -84,7 +84,8 @@
         # closing parenthesis
         # skip matching closing parenthesis
         elif char in [')', '}', ']']:
-            if char == self.editor.text(line)[col]:
+            txt = self.editor.text(line)
+            if col < len(txt) and char == txt[col]:
                 if self.__skipBrace:
                     self.editor.setSelection(line, col, line, col + 1)
                     self.editor.removeSelectedText()

eric ide

mercurial