From d3bf4fd4d6274afb376ac89b02467f3a6fdb05d0 Mon Sep 17 00:00:00 2001 From: Sanvi Date: Mon, 16 Mar 2026 15:06:03 +0700 Subject: [PATCH] Fix MinimapView hitTest intercepting clicks when hidden When showMinimap is false, MinimapView.isHidden is set to true but the hitTest override did not check isHidden. Combined with empty mouseDown/mouseDragged overrides, this caused the hidden minimap to silently swallow all click events in its frame area (~140px on the right side of the editor), preventing cursor placement. Add an isHidden guard at the top of hitTest so hidden minimap views return nil and let clicks pass through to the underlying text view. Closes CodeEditApp/CodeEditSourceEditor#370 --- Sources/CodeEditSourceEditor/Minimap/MinimapView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/CodeEditSourceEditor/Minimap/MinimapView.swift b/Sources/CodeEditSourceEditor/Minimap/MinimapView.swift index afd97dee7..9f9ef37fa 100644 --- a/Sources/CodeEditSourceEditor/Minimap/MinimapView.swift +++ b/Sources/CodeEditSourceEditor/Minimap/MinimapView.swift @@ -267,6 +267,7 @@ public class MinimapView: FlippedNSView { } override public func hitTest(_ point: NSPoint) -> NSView? { + guard !isHidden else { return nil } guard let point = superview?.convert(point, to: self) else { return nil } // For performance, don't hitTest the layout fragment views, but make sure the `documentVisibleView` is // hittable.