--- a/eric6/QScintilla/QsciScintillaCompat.py Wed Sep 25 18:25:43 2019 +0200 +++ b/eric6/QScintilla/QsciScintillaCompat.py Wed Sep 25 18:37:35 2019 +0200 @@ -11,8 +11,10 @@ from PyQt5.QtCore import pyqtSignal, Qt, QPoint from PyQt5.QtGui import QPalette, QColor, QFontMetrics from PyQt5.QtWidgets import QApplication, QListWidget -from PyQt5.Qsci import QsciScintillaBase, QsciScintilla, \ +from PyQt5.Qsci import ( + QsciScintillaBase, QsciScintilla, QSCINTILLA_VERSION as QSCIQSCINTILLA_VERSION +) ############################################################################### @@ -185,9 +187,10 @@ if isinstance(pos, int): scipos = pos else: - scipos = \ - self.SendScintilla(QsciScintilla.SCI_POSITIONFROMPOINT, - pos.x(), pos.y()) + scipos = self.SendScintilla( + QsciScintilla.SCI_POSITIONFROMPOINT, + pos.x(), pos.y() + ) line = self.SendScintilla(QsciScintilla.SCI_LINEFROMPOSITION, scipos) if line >= self.lines(): line = -1 @@ -303,9 +306,10 @@ @return fold level of the given line (integer) """ lvl = self.SendScintilla(QsciScintilla.SCI_GETFOLDLEVEL, line) - return \ - (lvl & QsciScintilla.SC_FOLDLEVELNUMBERMASK) - \ + return ( + (lvl & QsciScintilla.SC_FOLDLEVELNUMBERMASK) - QsciScintilla.SC_FOLDLEVELBASE + ) def foldFlagsAt(self, line): """ @@ -544,9 +548,11 @@ @return flag indicating a rectangular selection (boolean) """ startLine, startIndex, endLine, endIndex = self.getSelection() - return startLine != -1 and \ - startLine != endLine and \ + return ( + startLine != -1 and + startLine != endLine and self.SendScintilla(QsciScintilla.SCI_SELECTIONISRECTANGLE) + ) def getRectangularSelection(self): """ @@ -980,12 +986,16 @@ @param color color to be used by the indicator (QColor) @exception ValueError the indicator or style are not valid """ - if indicator < QsciScintilla.INDIC_CONTAINER or \ - indicator > QsciScintilla.INDIC_MAX: + if ( + indicator < QsciScintilla.INDIC_CONTAINER or + indicator > QsciScintilla.INDIC_MAX + ): raise ValueError("indicator number out of range") - if style < QsciScintilla.INDIC_PLAIN or \ - style > self.IndicatorStyleMax: + if ( + style < QsciScintilla.INDIC_PLAIN or + style > self.IndicatorStyleMax + ): raise ValueError("style out of range") self.SendScintilla(QsciScintilla.SCI_INDICSETSTYLE, indicator, style) @@ -1011,8 +1021,10 @@ QsciScintilla.INDIC_CONTAINER .. QsciScintilla.INDIC_MAX) @exception ValueError the indicator or style are not valid """ - if indicator < QsciScintilla.INDIC_CONTAINER or \ - indicator > QsciScintilla.INDIC_MAX: + if ( + indicator < QsciScintilla.INDIC_CONTAINER or + indicator > QsciScintilla.INDIC_MAX + ): raise ValueError("indicator number out of range") self.SendScintilla(QsciScintilla.SCI_SETINDICATORCURRENT, indicator) @@ -1554,8 +1566,9 @@ maxWidth = averageCharWidth * self.maxChars if width > maxWidth: width = maxWidth - height += userListWidget.horizontalScrollBar().sizeHint()\ - .height() + height += ( + userListWidget.horizontalScrollBar().sizeHint().height() + ) # List box doesn't honor limited size to show scroll bars, e.g. # Python 2 on Win 10. So just force it. userListWidget.setHorizontalScrollBarPolicy(