eric6/QScintilla/Lexers/__init__.py

changeset 7746
12d5e1e6abd1
parent 7743
817a81a2e6aa
child 7781
607a6098cb44
--- a/eric6/QScintilla/Lexers/__init__.py	Sat Oct 03 17:10:01 2020 +0200
+++ b/eric6/QScintilla/Lexers/__init__.py	Sat Oct 03 17:25:26 2020 +0200
@@ -10,8 +10,6 @@
 
 from PyQt5.QtCore import QCoreApplication
 
-from QScintilla.QsciScintillaCompat import QSCINTILLA_VERSION
-
 import Preferences
 import UI.PixmapCache
 
@@ -158,20 +156,12 @@
                     'dummy.po', "lexerGettext"],
         "CoffeeScript": [QCoreApplication.translate('Lexers', "CoffeeScript"),
                          'dummy.coffee', "lexerCoffeeScript"],
+        "JSON": [QCoreApplication.translate('Lexers', "JSON"), 'dummy.json',
+                 "lexerJSON"],
+        "Markdown": [QCoreApplication.translate('Lexers', "Markdown"),
+                     'dummy.md', "lexerMarkdown"],
     }
     
-    if QSCINTILLA_VERSION() >= 0x020a00:
-        supportedLanguages["JSON"] = [
-            QCoreApplication.translate('Lexers', "JSON"),
-            'dummy.json',
-            "lexerJSON"
-        ]
-        supportedLanguages["Markdown"] = [
-            QCoreApplication.translate('Lexers', "Markdown"),
-            'dummy.md',
-            "lexerMarkdown"
-        ]
-    
     for name in LexerRegistry:
         if not name.startswith("Pygments|"):
             supportedLanguages[name] = (
@@ -514,20 +504,14 @@
         QCoreApplication.translate(
             'Lexers',
             'CoffeeScript Files (*.coffee)'),
+        QCoreApplication.translate(
+            'Lexers',
+            'JSON Files (*.json)'),
+        QCoreApplication.translate(
+            'Lexers',
+            'Markdown Files (*.md)'),
     ]
     
-    if QSCINTILLA_VERSION() >= 0x020a00:
-        openFileFiltersList.append(
-            QCoreApplication.translate(
-                'Lexers',
-                'JSON Files (*.json)'),
-        )
-        openFileFiltersList.append(
-            QCoreApplication.translate(
-                'Lexers',
-                'Markdown Files (*.md)'),
-        )
-    
     for name in LexerRegistry:
         openFileFiltersList.extend(LexerRegistry[name][3])
     
@@ -725,20 +709,14 @@
         QCoreApplication.translate(
             'Lexers',
             'CoffeeScript Files (*.coffee)'),
+        QCoreApplication.translate(
+            'Lexers',
+            'JSON Files (*.json)'),
+        QCoreApplication.translate(
+            'Lexers',
+            'Markdown Files (*.md)'),
     ]
     
-    if QSCINTILLA_VERSION() >= 0x020a00:
-        saveFileFiltersList.append(
-            QCoreApplication.translate(
-                'Lexers',
-                'JSON Files (*.json)'),
-        )
-        saveFileFiltersList.append(
-            QCoreApplication.translate(
-                'Lexers',
-                'Markdown Files (*.md)'),
-        )
-    
     for name in LexerRegistry:
         saveFileFiltersList.extend(LexerRegistry[name][4])
     
@@ -889,16 +867,14 @@
         '*.proto': "Protocol",
         '*.po': "Gettext",
         '*.coffee': "CoffeeScript",
+        '*.json': "JSON",
+        '*.md': "Markdown",
         
         '*.toml': "Pygments|TOML",
         'Pipfile': "Pygments|TOML",
         'poetry.lock': "Pygments|TOML",
     }
     
-    if QSCINTILLA_VERSION() >= 0x020a00:
-        assocs['*.json'] = "JSON"
-        assocs['*.md'] = "Markdown"
-    
     for name in LexerRegistry:
         for pattern in LexerRegistry[name][5]:
             assocs[pattern] = name

eric ide

mercurial