diff --git a/mvc/models.py b/mvc/models.py index 7faf052..fadd738 100644 --- a/mvc/models.py +++ b/mvc/models.py @@ -114,6 +114,13 @@ class VimModel: del self.displayBuffer[self.currentLine][self.currentCol + 1] case "yy": # копирует текущую строку self.exchangeBuffer = self.displayBuffer[self.currentLine].copy() + case "yw": # Копирует слово под курсором + line = ''.join(self.displayBuffer[self.currentLine]) + start_index = line.rfind(' ', 0, self.currentCol) + start_index = 0 if start_index == -1 else start_index + 1 + end_index = line.find(' ', self.currentCol) + end_index = len(line) if end_index == -1 else end_index + self.exchangeBuffer = self.displayBuffer[self.currentLine][start_index:end_index].copy() case "dd": # вырезает текущую строку self.exchangeBuffer = self.displayBuffer[self.currentLine].copy() del self.displayBuffer[self.currentLine]