Skip to content

Commit 4dea2d2

Browse files
committed
Address scrollback repaint review feedback
1 parent 3a3a5e7 commit 4dea2d2

2 files changed

Lines changed: 1 addition & 11 deletions

File tree

Sources/SwiftTerm/Apple/AppleTerminalView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@ extension TerminalView {
18511851
// drawTerminalContents maps screen rects back to buffer rows via `yDisp`.
18521852
// Those two agree only while the viewport is pinned to the bottom. Once the
18531853
// user scrolls back by `k` rows, the cells that changed are drawn at screen
1854-
// row `y - k` while the invalidation still covers screen row `y`, so the rows
1854+
// row `y + k` while the invalidation still covers screen row `y`, so the rows
18551855
// that actually changed are never repainted and keep stale pixels until
18561856
// something forces a full redraw. Invalidate everything in that case; the
18571857
// draw still only repaints rows intersecting the dirty rect and reads each

Tests/SwiftTermTests/ScrollbackRepaintTests.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ import Testing
44
#if os(macOS)
55
import AppKit
66

7-
private final class ScrollbackRepaintDelegate: TerminalViewDelegate {
8-
func sizeChanged(source: TerminalView, newCols: Int, newRows: Int) {}
9-
func setTerminalTitle(source: TerminalView, title: String) {}
10-
func hostCurrentDirectoryUpdate(source: TerminalView, directory: String?) {}
11-
func send(source: TerminalView, data: ArraySlice<UInt8>) {}
12-
func scrolled(source: TerminalView, position: Double) {}
13-
func rangeChanged(source: TerminalView, startY: Int, endY: Int) {}
14-
}
15-
167
/// Records the rects `updateDisplay` asks AppKit to repaint.
178
private final class InvalidationCapturingTerminalView: TerminalView {
189
var invalidated: [NSRect] = []
@@ -38,7 +29,6 @@ struct ScrollbackRepaintTests {
3829
/// scrolls nor moves the cursor between rows.
3930
@Test func inPlaceRepaintWhileScrolledBackInvalidatesRenderedRow() {
4031
let view = InvalidationCapturingTerminalView(frame: CGRect(x: 0, y: 0, width: 640, height: 320))
41-
view.terminalDelegate = ScrollbackRepaintDelegate()
4232
let terminal: Terminal = view.terminal
4333
let cellHeight = view.cellDimension.height
4434

0 commit comments

Comments
 (0)