Пример #1
0
    def insertText(self):
        " Triggered when insert is requested "
        if self.isReadOnly():
            return True

        # Check what is in the buffer
        text = QApplication.clipboard().text()
        if '\n' in text or '\r' in text:
            return True

        if not self.inputEcho:
            self.inputBuffer += text
            return True

        startPos = self.currentPosition()
        TextEditor.paste(self)
        endPos = self.currentPosition()

        self.SendScintilla(self.SCI_STARTSTYLING, startPos, 31)
        self.SendScintilla(self.SCI_SETSTYLING, endPos - startPos,
                           self.stdinStyle)
        return True
Пример #2
0
    def insertText( self ):
        " Triggered when insert is requested "
        if self.isReadOnly():
            return True

        # Check what is in the buffer
        text = QApplication.clipboard().text()
        if '\n' in text or '\r' in text:
            return True

        if not self.inputEcho:
            self.inputBuffer += text
            return True

        startPos = self.currentPosition()
        TextEditor.paste( self )
        endPos = self.currentPosition()

        self.SendScintilla( self.SCI_STARTSTYLING, startPos, 31 )
        self.SendScintilla( self.SCI_SETSTYLING,
                            endPos - startPos, self.stdinStyle )
        return True