NG на линию комбинацией кнопок теперь переходит ровно на нее, pgup\pgdown теперь ровно на высоту дисплея скроллят
parent
6ed9b61e5f
commit
b6c9f087be
|
@ -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": # Переходит в начало строки и начинает ввод текста
|
||||
|
|
Loading…
Reference in New Issue