From b6c9f087be24a12a295114fae97555e797e5324d Mon Sep 17 00:00:00 2001 From: serr Date: Wed, 5 Feb 2025 21:13:50 +0300 Subject: [PATCH] =?UTF-8?q?NG=20=D0=BD=D0=B0=20=D0=BB=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=8E=20=D0=BA=D0=BE=D0=BC=D0=B1=D0=B8=D0=BD=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B5=D0=B9=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BE=D0=BA=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=B8=D1=82=20=D1=80=D0=BE=D0=B2=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BD=D0=B5=D0=B5,=20pgup\pgdown=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D1=8C=20=D1=80=D0=BE=D0=B2=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B2=D1=8B=D1=81=D0=BE=D1=82=D1=83=20=D0=B4?= =?UTF-8?q?=D0=B8=D1=81=D0=BF=D0=BB=D0=B5=D1=8F=20=D1=81=D0=BA=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D1=8F=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mvc/models.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mvc/models.py b/mvc/models.py index 198a557..8784938 100644 --- a/mvc/models.py +++ b/mvc/models.py @@ -101,14 +101,14 @@ class VimModel: def PageUp(self) -> None: self.currentCol = 0 if self.currentLine > self.displayLinesCount: - self.currentLine -= self.displayLinesCount + self.currentLine -= self.displayLinesCount - 2 else: self.currentLine = 0 def PageDown(self) -> None: self.currentCol = 0 if self.currentLine + self.displayLinesCount < len(self.displayBuffer): - self.currentLine += self.displayLinesCount + self.currentLine += self.displayLinesCount - 2 else: self.currentLine = len(self.displayBuffer) - 1 @@ -137,7 +137,7 @@ class VimModel: self.exchangeBuffer = self.displayBuffer[self.currentLine] def MoveToLine(self, numberLine: int) -> None: - numberLine += 1 + numberLine -= 1 if numberLine >= 0 and numberLine < len(self.displayBuffer): self.currentLine = numberLine self.currentCol = 0 @@ -151,9 +151,11 @@ class VimModel: return ReturnCode.EXIT_CODE case "q!": # Выход без сохранения return ReturnCode.EXIT_CODE - case "wq!": # Записать в текущий файл + выйти + case "wq!" | "x": # Записать в текущий файл + выйти self.SaveFile() return ReturnCode.EXIT_CODE + case "w": + self.SaveFile() case "i": # Вход в режим редактирования return ReturnCode.SET_EDIT_MODE case "I": # Переходит в начало строки и начинает ввод текста