Improve loads of fancy things in relation to the mouse pointer

This commit is contained in:
2026-10-07 13:02:52 +02:00
parent ed5a227c9d
commit a0b3ef9975
25 changed files with 334 additions and 89 deletions
+6 -4
View File
@@ -270,7 +270,7 @@ public final class EditorStore {
track { await $0.load(path, discardEdits: false) }
}
/// A click on a marked line in Actual: the Diff opens on HEAD vs disk, centred on that line.
/// Show diff on a marked line in Actual: the Diff opens on HEAD vs disk, centred on that line.
public func openDiff(atLine line: Int) {
guard let path = activePath, diff(for: path) != nil else { return }
let current = mode(for: path)
@@ -308,9 +308,11 @@ public final class EditorStore {
return PassOnRequest(reference: selection.reference.description, code: code, anchor: anchor)
}
/// The right-click menu for a line or selection in the code: exactly Pass on and Copy reference.
public func contextMenuRequest(reference: AgentReference, code: String?, anchor: CGPoint) -> ContextMenuRequest {
let target = ContextTarget.editor(reference: reference, code: code)
/// The right-click menu for a line or selection in the code: Pass on and Copy reference, plus Show diff
/// when `showDiffLine` names a marked line.
public func contextMenuRequest(reference: AgentReference, code: String?, showDiffLine: Int? = nil,
anchor: CGPoint) -> ContextMenuRequest {
let target = ContextTarget.editor(reference: reference, code: code, showDiffLine: showDiffLine)
return ContextMenuRequest(target: target, header: ContextActions.header(for: target, projectName: PathUtils.basename(root)),
entries: ContextActions.entries(for: target), anchor: anchor)
}