diff --git a/NvimView/NvimView/NvimView+Api.swift b/NvimView/NvimView/NvimView+Api.swift index 0ee127f1..c91d13a8 100644 --- a/NvimView/NvimView/NvimView+Api.swift +++ b/NvimView/NvimView/NvimView+Api.swift @@ -12,12 +12,12 @@ extension NvimView { public func enterResizeMode() { self.currentlyResizing = true - self.needsDisplay = true + self.markForRenderWholeView() } public func exitResizeMode() { self.currentlyResizing = false - self.needsDisplay = true + self.markForRenderWholeView() self.resizeNeoVimUi(to: self.bounds.size) } diff --git a/NvimView/NvimView/NvimView+Mouse.swift b/NvimView/NvimView/NvimView+Mouse.swift index 08fbf6f0..59d68492 100644 --- a/NvimView/NvimView/NvimView+Mouse.swift +++ b/NvimView/NvimView/NvimView+Mouse.swift @@ -66,7 +66,7 @@ extension NvimView { self.pinchBitmap = pinchImageRep self.isCurrentlyPinching = true - self.needsDisplay = true + self.markForRenderWholeView() case .ended, .cancelled: self.isCurrentlyPinching = false @@ -74,7 +74,7 @@ extension NvimView { self.pinchTargetScale = 1 default: - self.needsDisplay = true + self.markForRenderWholeView() } } diff --git a/NvimView/NvimView/NvimView+UiBridge.swift b/NvimView/NvimView/NvimView+UiBridge.swift index 00072b3b..79fb15c7 100644 --- a/NvimView/NvimView/NvimView+UiBridge.swift +++ b/NvimView/NvimView/NvimView+UiBridge.swift @@ -240,7 +240,9 @@ extension NvimView { ) self.ugrid.goto(position) - self.markForRender(cellPosition: self.ugrid.cursorPosition) + self.markForRender( + region: self.cursorRegion(for: self.ugrid.cursorPosition) + ) } private func doScroll(_ array: [Int]) { @@ -393,22 +395,6 @@ extension NvimView { extension NvimView { - final func markForRender(cellPosition position: Position) { - self.markForRender(position: position) - - if self.grid.isCellEmpty(position) { - self.markForRender(position: self.grid.previousCellPosition(position)) - } - - if self.grid.isNextCellEmpty(position) { - self.markForRender(position: self.grid.nextCellPosition(position)) - } - } - - final func markForRender(position: Position) { - self.markForRender(row: position.row, column: position.column) - } - final func markForRenderWholeView() { self.needsDisplay = true } diff --git a/NvimView/NvimView/NvimView.swift b/NvimView/NvimView/NvimView.swift index db95283a..1fc4aa72 100644 --- a/NvimView/NvimView/NvimView.swift +++ b/NvimView/NvimView/NvimView.swift @@ -125,7 +125,7 @@ public class NvimView: NSView, public var usesLigatures = false { didSet { self.runDrawer.usesLigatures = self.usesLigatures - self.needsDisplay = true + self.markForRenderWholeView() } }