HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.

Sat, 13 Feb 2021 20:07:45 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 13 Feb 2021 20:07:45 +0100
changeset 8103
338fe0064e5a
parent 8102
42e3c9e206b6
child 8104
96e9348ff55f

HighlightingStylesFile: added code for some aliased lexer names where the QScintilla name and the one used in eric are not identical.

eric6/Preferences/HighlightingStylesFile.py file | annotate | diff | comparison | revisions
eric6/Styles/eric6_Dark_1.ehj file | annotate | diff | comparison | revisions
eric6/Styles/eric6_Dark_2.ehj file | annotate | diff | comparison | revisions
--- a/eric6/Preferences/HighlightingStylesFile.py	Sat Feb 13 19:22:22 2021 +0100
+++ b/eric6/Preferences/HighlightingStylesFile.py	Sat Feb 13 20:07:45 2021 +0100
@@ -30,6 +30,11 @@
         @type QObject (optional)
         """
         super(HighlightingStylesFile, self).__init__(parent)
+        
+        self.__lexerAliases = {
+            "PO": "Gettext",
+            "POV": "Povray",
+        }
     
     def writeFile(self, filename: str, lexers: list) -> bool:
         """
@@ -54,8 +59,11 @@
         # step 1: add the lexer style data
         stylesDict["lexers"] = []
         for lexer in lexers:
+            name = lexer.language()
+            if name in self.__lexerAliases:
+                name = self.__lexerAliases[name]
             lexerDict = {
-                "name": lexer.language(),
+                "name": name,
                 "styles": [],
             }
             for description, style, substyle in lexer.getStyles():
--- a/eric6/Styles/eric6_Dark_1.ehj	Sat Feb 13 19:22:22 2021 +0100
+++ b/eric6/Styles/eric6_Dark_1.ehj	Sat Feb 13 20:07:45 2021 +0100
@@ -1,7 +1,7 @@
 {
   "header": {
     "comment": "eric highlighting styles file",
-    "saved": "2021-02-01, 14:25:58",
+    "saved": "2021-02-13, 20:02:51",
     "author": "Detlev Offenbach <detlev@die-offenbachs.de>"
   },
   "lexers": [
@@ -851,14 +851,14 @@
       ]
     },
     {
-      "name": "PO",
+      "name": "Gettext",
       "styles": [
         {
           "description": "Default",
           "style": 0,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -868,7 +868,7 @@
           "style": 1,
           "substyle": -1,
           "color": "#00d900",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -878,7 +878,7 @@
           "style": 2,
           "substyle": -1,
           "color": "#00ced9",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,75,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -888,7 +888,7 @@
           "style": 3,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -898,7 +898,7 @@
           "style": 4,
           "substyle": -1,
           "color": "#00ced9",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,75,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -908,7 +908,7 @@
           "style": 5,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -918,7 +918,7 @@
           "style": 6,
           "substyle": -1,
           "color": "#00ced9",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,75,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -928,7 +928,7 @@
           "style": 7,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -938,7 +938,7 @@
           "style": 8,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -948,7 +948,7 @@
           "style": 9,
           "substyle": -1,
           "color": "#00d900",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -958,7 +958,7 @@
           "style": 10,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -968,7 +968,7 @@
           "style": 11,
           "substyle": -1,
           "color": "#d9cfc4",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -978,7 +978,7 @@
           "style": 12,
           "substyle": -1,
           "color": "#ffaa00",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -988,7 +988,7 @@
           "style": 13,
           "substyle": -1,
           "color": "#ffaa00",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -998,7 +998,7 @@
           "style": 14,
           "substyle": -1,
           "color": "#ffaa00",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans Mono,9,-1,5,50,0,0,0,0,0",
           "eolfill": true,
           "words": ""
@@ -3231,14 +3231,14 @@
       ]
     },
     {
-      "name": "POV",
+      "name": "Povray",
       "styles": [
         {
           "description": "Default",
           "style": 0,
           "substyle": -1,
           "color": "#ff0080",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3248,7 +3248,7 @@
           "style": 1,
           "substyle": -1,
           "color": "#91fe8f",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Serif,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3258,7 +3258,7 @@
           "style": 2,
           "substyle": -1,
           "color": "#91fe8f",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Serif,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3268,7 +3268,7 @@
           "style": 3,
           "substyle": -1,
           "color": "#6beeee",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3278,7 +3278,7 @@
           "style": 4,
           "substyle": -1,
           "color": "#ffffff",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3288,7 +3288,7 @@
           "style": 5,
           "substyle": -1,
           "color": "#ffffff",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3298,7 +3298,7 @@
           "style": 6,
           "substyle": -1,
           "color": "#e274e5",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3318,7 +3318,7 @@
           "style": 8,
           "substyle": -1,
           "color": "#fefe00",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Sans,9,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3328,7 +3328,7 @@
           "style": 9,
           "substyle": -1,
           "color": "#ff8040",
-          "paper": "#2e3436",
+          "paper": "#2e2e2e",
           "font": "Bitstream Vera Serif,9,-1,5,50,1,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -3433,7 +3433,7 @@
           "style": 2,
           "substyle": -1,
           "color": "#ec8aef",
-          "paper": "#393d3d",
+          "paper": "#262626",
           "font": "Hack,10,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
--- a/eric6/Styles/eric6_Dark_2.ehj	Sat Feb 13 19:22:22 2021 +0100
+++ b/eric6/Styles/eric6_Dark_2.ehj	Sat Feb 13 20:07:45 2021 +0100
@@ -1,7 +1,7 @@
 {
   "header": {
     "comment": "eric highlighting styles file",
-    "saved": "2021-02-01, 14:47:56",
+    "saved": "2021-02-13, 19:30:17",
     "author": "Detlev Offenbach <detlev@die-offenbachs.de>"
   },
   "lexers": [
@@ -851,7 +851,7 @@
       ]
     },
     {
-      "name": "PO",
+      "name": "Gettext",
       "styles": [
         {
           "description": "Default",
@@ -3231,7 +3231,7 @@
       ]
     },
     {
-      "name": "POV",
+      "name": "Povray",
       "styles": [
         {
           "description": "Default",
@@ -3433,7 +3433,7 @@
           "style": 2,
           "substyle": -1,
           "color": "#ec8aef",
-          "paper": "#393d3d",
+          "paper": "#2e2e2e",
           "font": "Hack,10,-1,5,50,0,0,0,0,0",
           "eolfill": false,
           "words": ""
@@ -5891,4 +5891,4 @@
       ]
     }
   ]
-}
\ No newline at end of file
+}

eric ide

mercurial