Fixed an issue with the editor not activating the correct typing completer in some situations. 5_0_x

Wed, 05 Jan 2011 16:21:11 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 05 Jan 2011 16:21:11 +0100
branch
5_0_x
changeset 809
0f19e2fdce8f
parent 800
4daa1d31f4ba
child 810
09ab11885d37

Fixed an issue with the editor not activating the correct typing completer in some situations.

QScintilla/Editor.py file | annotate | diff | comparison | revisions
QScintilla/Lexers/__init__.py file | annotate | diff | comparison | revisions
QScintilla/TypingCompleters/__init__.py file | annotate | diff | comparison | revisions
--- a/QScintilla/Editor.py	Sun Jan 02 10:28:00 2011 +0100
+++ b/QScintilla/Editor.py	Wed Jan 05 16:21:11 2011 +0100
@@ -1416,6 +1416,13 @@
         
         filename = os.path.basename(filename)
         apiLanguage = Preferences.getEditorLexerAssoc(filename)
+        if apiLanguage == "":
+            if self.isPyFile():
+                apiLanguage = "Python2"
+            elif self.isPy3File():
+                apiLanguage = "Python3"
+            elif self.isRubyFile():
+                apiLanguage = "Ruby"
         
         self.completer = TypingCompleters.getCompleter(apiLanguage, self)
         
--- a/QScintilla/Lexers/__init__.py	Sun Jan 02 10:28:00 2011 +0100
+++ b/QScintilla/Lexers/__init__.py	Wed Jan 05 16:21:11 2011 +0100
@@ -117,7 +117,7 @@
     """
     if not pyname:
         try:
-            if language in ["Python", "Python3"]:
+            if language in ["Python", "Python2", "Python3"]:
                 from .LexerPython import LexerPython
                 return LexerPython(parent)
             elif language == "C++":
--- a/QScintilla/TypingCompleters/__init__.py	Sun Jan 02 10:28:00 2011 +0100
+++ b/QScintilla/TypingCompleters/__init__.py	Wed Jan 05 16:21:11 2011 +0100
@@ -17,7 +17,7 @@
     @return reference to the instanciated lexer object (QsciLexer)
     """
     try:
-        if language == "Python":
+        if language in ["Python", "Python2", "Python3"]:
             from .CompleterPython import CompleterPython
             return CompleterPython(editor, parent)
         elif language == "Ruby":

eric ide

mercurial