code: def cmdDelete(self, cmd, count):
          
          cursor = self._qpart.textCursor()
          direction = QTextCursor.Left if cmd == _X else QTextCursor.Right
          for _ in range(count):
              cursor.movePosition(direction, QTextCursor.KeepAnchor)
  
          if cursor.selectedText():
              _globalClipboard.value = cursor.selectedText()
              cursor.removeSelectedText()
  
          self._saveLastEditSimpleCmd(cmd, count)
docs: x