(self, *args)
Sometimes color themes will be supported.
        Now black on white is hardcoded in the highlighters.
        Hardcode same palette for not highlighted text
Sometimes color themes will be supported.
        Now black on white is hardcoded in the highlighters.
        Hardcode same palette for not highlighted text
Sometimes color themes will be supported . Now black on white is hardcoded in the highlighters . Hardcode same palette for not highlighted text
def __init__(self, *args):
        QPlainTextEdit.__init__(self, *args)

        self.setAttribute(Qt.WA_KeyCompression, False)  # vim can't process compressed keys

        self._lastKeyPressProcessedByParent = False
        # toPlainText() takes a lot of time on long texts, therefore it is cached
        self._cachedText = None

        self._fontBackup = self.font()

        self._eol = self._DEFAULT_EOL
        self._indenter = Indenter(self)
        self._lineLengthEdge = None
        self._lineLengthEdgeColor = QColor(255, 0, 0, 128)
        self._atomicModificationDepth = 0

        self.drawIncorrectIndentation = True
        self.drawAnyWhitespace = False
        self._drawIndentations = True
        self._drawSolidEdge = False
        self._solidEdgeLine = EdgeLine(self)
        self._solidEdgeLine.setVisible(False)

        self._rectangularSelection = RectangularSelection(self)

        """Sometimes color themes will be supported.
        Now black on white is hardcoded in the highlighters.
        Hardcode same palette for not highlighted text
        """
        palette = self.palette()
        # don't clear syntax highlighting when highlighting text
        palette.setBrush(QPalette.HighlightedText, QBrush(Qt.NoBrush))
        if QApplication.instance().property('darkMode'):
            palette.setColor(QPalette.Base, QColor('#111111'))
            palette.setColor(QPalette.Text, QColor('#ffffff'))
            palette.setColor(QPalette.Highlight, QColor('#444444'))
            self._currentLineColor = QColor('#111111')
        else:
            palette.setColor(QPalette.Base, QColor('#ffffff'))
            palette.setColor(QPalette.Text, QColor('#000000'))
            self._currentLineColor = QColor('#ffffff')
        self.setPalette(palette)

        self._bracketHighlighter = BracketHighlighter()

        self._lines = Lines(self)

        self.completionThreshold = self._DEFAULT_COMPLETION_THRESHOLD
        self.completionEnabled = self._DEFAULT_COMPLETION_ENABLED
        self._completer = Completer(self)
        self.auto_invoke_completions = False
        self.dot_invoke_completions = False

        doc = self.document()
        highlighter = PygmentsHighlighter(doc)
        doc.highlighter = highlighter

        self._vim = None

        self._initActions()

        self._line_number_margin = LineNumberArea(self)
        self._marginWidth = -1

        self._nonVimExtraSelections = []
        # we draw bracket highlighting, current line and extra selections by user
        self._userExtraSelections = []
        self._userExtraSelectionFormat = QTextCharFormat()
        self._userExtraSelectionFormat.setBackground(QBrush(QColor('#ffee00')))

        self._lintMarks = {}

        self.cursorPositionChanged.connect(self._updateExtraSelections)
        self.textChanged.connect(self._dropUserExtraSelections)
        self.textChanged.connect(self._resetCachedText)
        self.textChanged.connect(self._clearLintMarks)

        self._updateExtraSelections()
def __init__ ( self , * args ) : QPlainTextEdit . __init__ ( self , * args ) self . setAttribute ( Qt . WA_KeyCompression , False ) # vim can't process compressed keys self . _lastKeyPressProcessedByParent = False # toPlainText() takes a lot of time on long texts, therefore it is cached self . _cachedText = None self . _fontBackup = self . font ( ) self . _eol = self . _DEFAULT_EOL self . _indenter = Indenter ( self ) self . _lineLengthEdge = None self . _lineLengthEdgeColor = QColor ( 255 , 0 , 0 , 128 ) self . _atomicModificationDepth = 0 self . drawIncorrectIndentation = True self . drawAnyWhitespace = False self . _drawIndentations = True self . _drawSolidEdge = False self . _solidEdgeLine = EdgeLine ( self ) self . _solidEdgeLine . setVisible ( False ) self . _rectangularSelection = RectangularSelection ( self ) palette = self . palette ( ) # don't clear syntax highlighting when highlighting text palette . setBrush ( QPalette . HighlightedText , QBrush ( Qt . NoBrush ) ) if QApplication . instance ( ) . property ( 'darkMode' ) : palette . setColor ( QPalette . Base , QColor ( '#111111' ) ) palette . setColor ( QPalette . Text , QColor ( '#ffffff' ) ) palette . setColor ( QPalette . Highlight , QColor ( '#444444' ) ) self . _currentLineColor = QColor ( '#111111' ) else : palette . setColor ( QPalette . Base , QColor ( '#ffffff' ) ) palette . setColor ( QPalette . Text , QColor ( '#000000' ) ) self . _currentLineColor = QColor ( '#ffffff' ) self . setPalette ( palette ) self . _bracketHighlighter = BracketHighlighter ( ) self . _lines = Lines ( self ) self . completionThreshold = self . _DEFAULT_COMPLETION_THRESHOLD self . completionEnabled = self . _DEFAULT_COMPLETION_ENABLED self . _completer = Completer ( self ) self . auto_invoke_completions = False self . dot_invoke_completions = False doc = self . document ( ) highlighter = PygmentsHighlighter ( doc ) doc . highlighter = highlighter self . _vim = None self . _initActions ( ) self . _line_number_margin = LineNumberArea ( self ) self . _marginWidth = - 1 self . _nonVimExtraSelections = [ ] # we draw bracket highlighting, current line and extra selections by user self . _userExtraSelections = [ ] self . _userExtraSelectionFormat = QTextCharFormat ( ) self . _userExtraSelectionFormat . setBackground ( QBrush ( QColor ( '#ffee00' ) ) ) self . _lintMarks = { } self . cursorPositionChanged . connect ( self . _updateExtraSelections ) self . textChanged . connect ( self . _dropUserExtraSelections ) self . textChanged . connect ( self . _resetCachedText ) self . textChanged . connect ( self . _clearLintMarks ) self . _updateExtraSelections ( )