комманда b -> перемещает курсора в начало слова слева от курсора
parent
5cf89f71f9
commit
f76504249b
|
@ -93,6 +93,16 @@ class VimModel:
|
||||||
self.currentCol = right_space_index
|
self.currentCol = right_space_index
|
||||||
else:
|
else:
|
||||||
self.currentCol = len(self.displayBuffer[self.currentLine])
|
self.currentCol = len(self.displayBuffer[self.currentLine])
|
||||||
|
case "b": # Перемещает курсор в конец в начало слова слева от курсора
|
||||||
|
line = ''.join(self.displayBuffer[self.currentLine])
|
||||||
|
non_space_index = next((i for i in range(self.currentCol - 1, -1, -1) if line[i] != ' '), None)
|
||||||
|
if non_space_index is not None:
|
||||||
|
left_space_index = line.rfind(' ', 0, non_space_index)
|
||||||
|
if left_space_index != -1:
|
||||||
|
self.currentCol = left_space_index + 1
|
||||||
|
else:
|
||||||
|
self.currentCol = 0
|
||||||
|
|
||||||
|
|
||||||
def Enter(self) -> None:
|
def Enter(self) -> None:
|
||||||
# Разделяем текущую строку на две части
|
# Разделяем текущую строку на две части
|
||||||
|
|
Loading…
Reference in New Issue