QScintilla/Lexers/LexerPython.py

changeset 6872
96bb40e987f7
parent 6855
4d80c8cc99a1
child 6873
47804e8cde27
--- a/QScintilla/Lexers/LexerPython.py	Sun Mar 17 12:01:49 2019 +0100
+++ b/QScintilla/Lexers/LexerPython.py	Sun Mar 17 12:18:40 2019 +0100
@@ -206,7 +206,21 @@
         @param kwSet number of the keyword set (integer)
         @return string giving the keywords (string) or None
         """
-        return QsciLexerPython.keywords(self, kwSet)
+        if kwSet == 1:
+            if self.language() in ["Python", "Python2"]:
+                keywords = "and as assert break class continue def del elif " \
+                           "else except exec finally for from global if " \
+                           "import in is lambda not or pass print raise " \
+                           "return try while with yield"
+            elif self.language() == "Python3":
+                keywords = "False None True and as assert break class " \
+                           "continue def del elif else except finally for " \
+                           "from global if import in is lambda nonlocal not " \
+                           "or pass raise return try while with yield"
+            else:
+                keywords = QsciLexerPython.keywords(self, kwSet)
+        
+        return keywords
     
     def maximumKeywordSet(self):
         """

eric ide

mercurial