Skip to content

Commit 7eec4c2

Browse files
committed
Consider Buffer Y Offset In Mouse Hit
1 parent f55b5b7 commit 7eec4c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/SwiftTerm/Mac/MacTerminalView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,11 @@ open class TerminalView: NSView, NSTextInputClient, NSUserInterfaceValidations,
889889
}
890890
let point = convert(event.locationInWindow, from: nil)
891891
let col = Int (point.x / cellDimension.width)
892-
let row = Int ((frame.height-point.y) / cellDimension.height)
892+
let row = Int ((frame.height-point.y) / cellDimension.height) + terminal.buffer.yDisp
893893
if row < 0 {
894894
return (Position(col: 0, row: 0), toInt (point))
895895
}
896-
return (Position(col: min (max (0, col), terminal.cols-1), row: min (row, terminal.rows-1)), toInt (point))
896+
return (Position(col: min (max (0, col), terminal.cols-1), row: row), toInt (point))
897897
}
898898

899899
private func sharedMouseEvent (with event: NSEvent)

0 commit comments

Comments
 (0)