From b17ecd7fcef3b89a73a329b422ca3d5ae422d9c5 Mon Sep 17 00:00:00 2001 From: serr Date: Tue, 4 Feb 2025 22:49:50 +0300 Subject: [PATCH] =?UTF-8?q?yw=20->=20=D0=BA=D0=BE=D0=BF=D0=B8=D1=80=D1=83?= =?UTF-8?q?=D0=B5=D1=82=20=D1=81=D0=BB=D0=BE=D0=B2=D0=BE=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=BA=D1=83=D1=80=D1=81=D0=BE=D1=80=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mvc/models.py | 7 +++++++ 1 file changed, 7 insertions(+) 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]