1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

refactor: sink _unmarkText

This commit is contained in:
solawing 2021-10-06 20:27:59 +08:00
parent 918fc44889
commit bb8b920d0c

View File

@ -59,18 +59,7 @@ public extension NvimView {
.deleteCharacters(length, andInputEscapedString: self.vimPlainString(text))
.wait()
if length > 0 {
self.ugrid.unmarkCell(at: self.markedPosition)
self.markForRender(position: self.markedPosition)
if self.ugrid.isNextCellEmpty(self.markedPosition) {
self.ugrid.unmarkCell(at: self.markedPosition.advancing(row: 0, column: 1))
self.markForRender(position: self.markedPosition.advancing(row: 0, column: 1))
}
}
self.lastMarkedText = self.markedText
self.markedText = nil
self.markedPosition = .null
if self.hasMarkedText() { _unmarkText() }
self.keyDownDone = true
}
@ -195,6 +184,11 @@ public extension NvimView {
}
func unmarkText() {
_unmarkText()
self.keyDownDone = true
}
func _unmarkText() {
let position = self.markedPosition
self.ugrid.unmarkCell(at: position)
self.markForRender(position: position)
@ -205,7 +199,6 @@ public extension NvimView {
self.markedText = nil
self.markedPosition = .null
self.keyDownDone = true
}
/**