QScintilla: pushed required QScintilla version to 2.11.1.

Sat, 03 Oct 2020 17:25:26 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 03 Oct 2020 17:25:26 +0200
changeset 7746
12d5e1e6abd1
parent 7745
43888e12e481
child 7747
4f0b034f4c34

QScintilla: pushed required QScintilla version to 2.11.1.

eric6/QScintilla/Editor.py file | annotate | diff | comparison | revisions
eric6/QScintilla/Lexers/__init__.py file | annotate | diff | comparison | revisions
eric6/QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
eric6/QScintilla/QsciScintillaCompat.py file | annotate | diff | comparison | revisions
eric6/ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
--- a/eric6/QScintilla/Editor.py	Sat Oct 03 17:10:01 2020 +0200
+++ b/eric6/QScintilla/Editor.py	Sat Oct 03 17:25:26 2020 +0200
@@ -27,7 +27,7 @@
 from E5Gui import E5FileDialog, E5MessageBox
 from E5Utilities.E5Cache import E5Cache
 
-from .QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION
+from .QsciScintillaCompat import QsciScintillaCompat
 from .EditorMarkerMap import EditorMarkerMap
 from .SpellChecker import SpellChecker
 
@@ -4593,8 +4593,7 @@
         self.caretWidth = Preferences.getEditor("CaretWidth")
         self.setCaretWidth(self.caretWidth)
         self.caretLineFrameWidth = Preferences.getEditor("CaretLineFrameWidth")
-        if QSCINTILLA_VERSION() >= 0x020B00:
-            self.setCaretLineFrameWidth(self.caretLineFrameWidth)
+        self.setCaretLineFrameWidth(self.caretLineFrameWidth)
         self.useMonospaced = Preferences.getEditor("UseMonospacedFont")
         self.setMonospaced(self.useMonospaced)
         edgeMode = Preferences.getEditor("EdgeMode")
--- 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
--- a/eric6/QScintilla/MiniEditor.py	Sat Oct 03 17:10:01 2020 +0200
+++ b/eric6/QScintilla/MiniEditor.py	Sat Oct 03 17:25:26 2020 +0200
@@ -27,7 +27,7 @@
 from E5Gui import E5MessageBox, E5FileDialog
 from E5Gui.E5MainWindow import E5MainWindow
 
-from .QsciScintillaCompat import QsciScintillaCompat, QSCINTILLA_VERSION
+from .QsciScintillaCompat import QsciScintillaCompat
 
 import UI.PixmapCache
 import UI.Config
@@ -1346,18 +1346,17 @@
         act.triggered.connect(self.esm.map)
         self.editActions.append(act)
         
-        if QSCINTILLA_VERSION() >= 0x020B00:
-            act = E5Action(
-                QCoreApplication.translate('ViewManager',
-                                           'Reverse selected lines'),
-                QCoreApplication.translate('ViewManager',
-                                           'Reverse selected lines'),
-                QKeySequence(QCoreApplication.translate('ViewManager',
-                                                        'Meta+Alt+R')),
-                0, self.editorActGrp, 'vm_edit_reverse selected_lines')
-            self.esm.setMapping(act, QsciScintilla.SCI_LINEREVERSE)
-            act.triggered.connect(self.esm.map)
-            self.editActions.append(act)
+        act = E5Action(
+            QCoreApplication.translate('ViewManager',
+                                       'Reverse selected lines'),
+            QCoreApplication.translate('ViewManager',
+                                       'Reverse selected lines'),
+            QKeySequence(QCoreApplication.translate('ViewManager',
+                                                    'Meta+Alt+R')),
+            0, self.editorActGrp, 'vm_edit_reverse selected_lines')
+        self.esm.setMapping(act, QsciScintilla.SCI_LINEREVERSE)
+        act.triggered.connect(self.esm.map)
+        self.editActions.append(act)
         
         act = E5Action(
             QCoreApplication.translate('ViewManager', 'Cut current line'),
@@ -2738,8 +2737,7 @@
         self.caretWidth = Preferences.getEditor("CaretWidth")
         self.__textEdit.setCaretWidth(self.caretWidth)
         self.caretLineFrameWidth = Preferences.getEditor("CaretLineFrameWidth")
-        if QSCINTILLA_VERSION() >= 0x020B00:
-            self.__textEdit.setCaretLineFrameWidth(self.caretLineFrameWidth)
+        self.__textEdit.setCaretLineFrameWidth(self.caretLineFrameWidth)
         self.useMonospaced = Preferences.getEditor("UseMonospacedFont")
         self.__setMonospaced(self.useMonospaced)
         edgeMode = Preferences.getEditor("EdgeMode")
--- a/eric6/QScintilla/QsciScintillaCompat.py	Sat Oct 03 17:10:01 2020 +0200
+++ b/eric6/QScintilla/QsciScintillaCompat.py	Sat Oct 03 17:25:26 2020 +0200
@@ -47,12 +47,7 @@
     
     UserSeparator = '\x04'
     
-    if QSCINTILLA_VERSION() < 0x020A00:
-        IndicatorStyleMax = QsciScintilla.INDIC_TEXTFORE
-    elif QSCINTILLA_VERSION() < 0x020B00:
-        IndicatorStyleMax = QsciScintilla.INDIC_POINTCHARACTER
-    else:
-        IndicatorStyleMax = QsciScintilla.INDIC_GRADIENTCENTRE
+    IndicatorStyleMax = QsciScintilla.INDIC_GRADIENTCENTRE
     
     def __init__(self, parent=None):
         """
@@ -1645,17 +1640,6 @@
     ## methods to implement workarounds for broken things
     ###########################################################################
     
-    if QSCINTILLA_VERSION() == 0x020B00:
-        def insert(self, txt):
-            """
-            Public method to insert text at the cursor position.
-            
-            @param txt text to be inserted
-            @type str
-            """
-            line, col = self.getCursorPosition()
-            self.insertAt(txt, line, col)
-    
     def positionFromLineIndex(self, line, index):
         """
         Public method to convert line and index to an absolute position.
@@ -1710,54 +1694,6 @@
                 self.foldLine(line)
     
     #########################################################################
-    ## Method below implements a compatibility variant for the findFirst()
-    ## extended with version 2.11.
-    #########################################################################
-
-    def findFirst(self, expression, regexp, caseSensitive, word, wrap,
-                  forward=True, line=-1, index=-1, show=True, posix=False,
-                  cxx11=False):
-        """
-        Public method to search in the current editor text.
-        
-        @param expression search expression
-        @type str
-        @param regexp flag indicating a regular expression
-        @type bool
-        @param caseSensitive flag indicating a case sensitive search
-        @type bool
-        @param word flag indicating a word only search
-        @type bool
-        @param wrap flag indicating to warp around
-        @type bool
-        @param forward flag indicating the search direction
-        @type bool
-        @param line line to start the search on
-        @type int
-        @param index index to start the search on
-        @type int
-        @param show flag indicating to set the selection to the found
-            expression
-        @type bool
-        @param posix flag indicating the POSIX regular expression search mode
-        @type bool
-        @param cxx11 flag indicating the CXX11 regular expression search mode
-        @type bool
-        @return flag indicating a successful search
-        @rtype bool
-        """
-        if QSCINTILLA_VERSION() >= 0x020B00:
-            return super(QsciScintillaCompat, self).findFirst(
-                expression, regexp, caseSensitive, word, wrap,
-                forward=forward, line=line, index=index, show=show,
-                posix=posix, cxx11=cxx11)
-        else:
-            return super(QsciScintillaCompat, self).findFirst(
-                expression, regexp, caseSensitive, word, wrap,
-                forward=forward, line=line, index=index, show=show,
-                posix=posix)
-    
-    #########################################################################
     ## Methods below are missing from QScintilla.
     #########################################################################
 
--- a/eric6/ViewManager/ViewManager.py	Sat Oct 03 17:10:01 2020 +0200
+++ b/eric6/ViewManager/ViewManager.py	Sat Oct 03 17:25:26 2020 +0200
@@ -29,7 +29,6 @@
 import Preferences
 
 from QScintilla.Editor import Editor
-from QScintilla.QsciScintillaCompat import QSCINTILLA_VERSION
 
 import Utilities
 
@@ -2146,18 +2145,17 @@
         act.triggered.connect(self.esm.map)
         self.editActions.append(act)
         
-        if QSCINTILLA_VERSION() >= 0x020B00:
-            act = E5Action(
-                QCoreApplication.translate('ViewManager',
-                                           'Reverse selected lines'),
-                QCoreApplication.translate('ViewManager',
-                                           'Reverse selected lines'),
-                QKeySequence(QCoreApplication.translate('ViewManager',
-                                                        'Meta+Alt+R')),
-                0, self.editorActGrp, 'vm_edit_reverse selected_lines')
-            self.esm.setMapping(act, QsciScintilla.SCI_LINEREVERSE)
-            act.triggered.connect(self.esm.map)
-            self.editActions.append(act)
+        act = E5Action(
+            QCoreApplication.translate('ViewManager',
+                                       'Reverse selected lines'),
+            QCoreApplication.translate('ViewManager',
+                                       'Reverse selected lines'),
+            QKeySequence(QCoreApplication.translate('ViewManager',
+                                                    'Meta+Alt+R')),
+            0, self.editorActGrp, 'vm_edit_reverse selected_lines')
+        self.esm.setMapping(act, QsciScintilla.SCI_LINEREVERSE)
+        act.triggered.connect(self.esm.map)
+        self.editActions.append(act)
         
         act = E5Action(
             QCoreApplication.translate('ViewManager', 'Cut current line'),
--- a/scripts/install.py	Sat Oct 03 17:10:01 2020 +0200
+++ b/scripts/install.py	Sat Oct 03 17:25:26 2020 +0200
@@ -1614,8 +1614,12 @@
         major = int(major)
         minor = int(minor)
         pat = int(pat)
-        if major < 2 or (major == 2 and minor < 9):
-            print('Sorry, you must have QScintilla 2.9.0 or higher or'
+        if (
+            major < 2 or
+            (major == 2 and minor < 11) or
+            (major == 2 and minor == 11 and pat < 1)
+        ):
+            print('Sorry, you must have QScintilla 2.11.1 or higher or'
                   ' a recent snapshot release.')
             exit(5)
         # check for blacklisted versions

eric ide

mercurial