code: def cmdSubstituteLines(self, cmd, count):
          
          lineIndex = self._qpart.cursorPosition[0]
          availableCount = len(self._qpart.lines) - lineIndex
          effectiveCount = min(availableCount, count)
  
          _globalClipboard.value = self._qpart.lines[lineIndex:lineIndex + effectiveCount]
          with self._qpart:
              del self._qpart.lines[lineIndex:lineIndex + effectiveCount]
              self._qpart.lines.insert(lineIndex, '')
              self._qpart.cursorPosition = (lineIndex, 0)
              self._qpart._indenter.autoIndentBlock(self._qpart.textCursor().block())
  
          self._saveLastEditSimpleCmd(cmd, count)
          self.switchMode(Insert)
docs: S