diff --git a/mvc/models.py b/mvc/models.py index 79ad355..a0e6d8e 100644 --- a/mvc/models.py +++ b/mvc/models.py @@ -18,6 +18,7 @@ class VimModel: self.file_path = "" # путь к файлу self.mode = "" self.commandBuffer = [] # буффер для команды + self.exchangeBuffer = [] # буффер обмена def ModeBar(self) -> str: modeBar = f"MODE: {self.mode} | FILE: {self.file_path} | LINE: {self.currentLine+1}/{len(self.displayBuffer)}" @@ -111,6 +112,11 @@ class VimModel: case "x": # Удаляет символ после курсора if self.currentCol + 1 < len(self.displayBuffer[self.currentLine]): del self.displayBuffer[self.currentLine][self.currentCol + 1] + case "yy": # копирует текущую строку + self.exchangeBuffer = self.displayBuffer[self.currentLine].copy() + case "p": # вставить после курсора + self.displayBuffer[self.currentLine][self.currentCol+1:self.currentCol+1] = self.exchangeBuffer + return ReturnCode.GOOD def Enter(self) -> None: