code: def paste(self, mimeData):
          
          if self.isActive():
              self.delete()
          elif self._qpart.textCursor().hasSelection():
              self._qpart.textCursor().deleteChar()
  
          text = bytes(mimeData.data(self.MIME_TYPE)).decode('utf8')
          lines = text.splitlines()
          cursorLine, cursorCol = self._qpart.cursorPosition
          if cursorLine + len(lines) > len(self._qpart.lines):
             for i in range(cursorLine + len(lines) - len(self._qpart.lines)):
                 self._qpart.lines.append('')
  
          with self._qpart:
              for index, line in enumerate(lines):
                  currentLine = self._qpart.lines[cursorLine + index]
                  newLine = currentLine[:cursorCol] + \
                            self._indentUpTo(currentLine, cursorCol) + \
                            line + \
                            currentLine[cursorCol:]
                  self._qpart.lines[cursorLine + index] = newLine
          self._qpart.cursorPosition = cursorLine, cursorCol
docs: Paste recrangular selection.
          Add space at the beginning of line, if necessary