yw -> копирует слово под курсором
parent
c7226e304f
commit
b17ecd7fce
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue