eric6/QScintilla/QsciScintillaCompat.py

changeset 8260
2161475d9639
parent 8243
cc717c2ae956
child 8485
bb395ec2a6af
--- a/eric6/QScintilla/QsciScintillaCompat.py	Wed Apr 21 19:40:50 2021 +0200
+++ b/eric6/QScintilla/QsciScintillaCompat.py	Thu Apr 22 18:02:47 2021 +0200
@@ -180,13 +180,12 @@
         @return linenumber at position or -1, if there is no line at pos
             (integer, zero based)
         """
-        if isinstance(pos, int):
-            scipos = pos
-        else:
-            scipos = self.SendScintilla(
-                QsciScintilla.SCI_POSITIONFROMPOINT,
-                pos.x(), pos.y()
-            )
+        scipos = (
+            pos
+            if isinstance(pos, int) else
+            self.SendScintilla(QsciScintilla.SCI_POSITIONFROMPOINT,
+                               pos.x(), pos.y())
+        )
         line = self.SendScintilla(QsciScintilla.SCI_LINEFROMPOSITION, scipos)
         if line >= self.lines():
             line = -1
@@ -958,10 +957,11 @@
         if not self.__targetSearchActive:
             return
         
-        if self.__targetSearchFlags & QsciScintilla.SCFIND_REGEXP:
-            cmd = QsciScintilla.SCI_REPLACETARGETRE
-        else:
-            cmd = QsciScintilla.SCI_REPLACETARGET
+        cmd = (
+            QsciScintilla.SCI_REPLACETARGETRE
+            if self.__targetSearchFlags & QsciScintilla.SCFIND_REGEXP else
+            QsciScintilla.SCI_REPLACETARGET
+        )
         r = self._encodeString(replaceStr)
         
         start = self.SendScintilla(QsciScintilla.SCI_GETTARGETSTART)

eric ide

mercurial