Skip to content

Commit ee0c00a

Browse files
Only Show Jump to Def When Available (#349)
Only shows the jump to definition hover interaction when a delegate is available.
1 parent c0d2c90 commit ee0c00a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/CodeEditSourceEditor/JumpToDefinition/JumpToDefinitionModel.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ final class JumpToDefinitionModel {
119119
// MARK: - Mouse Interaction
120120

121121
func mouseHovered(windowCoordinates: CGPoint) {
122-
guard let textViewCoords = textView?.convert(windowCoordinates, from: nil),
122+
guard delegate != nil,
123+
let textViewCoords = textView?.convert(windowCoordinates, from: nil),
123124
let location = textView?.layoutManager.textOffsetAtPoint(textViewCoords),
124125
location < textView?.textStorage.length ?? 0 else {
125126
cancelHover()

0 commit comments

Comments
 (0)