-
Notifications
You must be signed in to change notification settings - Fork 447
Fix implicit-link boundaries and link cursor flicker #650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1048,7 +1048,19 @@ open class TerminalView: NSView, NSTextInputClient, NSUserInterfaceValidations, | |
|
|
||
| public override func cursorUpdate(with event: NSEvent) | ||
| { | ||
| NSCursor.iBeam.set () | ||
| let hit = calculateMouseHit(with: event).grid | ||
| let hasCommandModifier = commandActive || event.modifierFlags.contains(.command) | ||
| updateHoverLink(at: hit, commandOverride: hasCommandModifier) | ||
| linkCursor(at: hit, hasCommandModifier: hasCommandModifier).set() | ||
| } | ||
|
|
||
| func linkCursor(at position: Position, hasCommandModifier: Bool) -> NSCursor | ||
| { | ||
| guard let match = terminal.linkMatch(at: .buffer(position), mode: .explicitAndImplicit), | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, the same call always uses .explicitAndImplicit. With the default .hoverWithModifier mode, it runs the full implicit-link regex even when Command is not pressed. When Command is pressed, updateHoverLink performs the lookup first, and linkCursor immediately performs it again. Use implicitLinkCouldBeVisible to select the mode, or reuse the result from updateHoverLink. |
||
| linkVisibleForClick(match: match, hasCommandModifier: hasCommandModifier) else { | ||
| return .iBeam | ||
| } | ||
| return .pointingHand | ||
| } | ||
|
|
||
| func makeFirstResponder () | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use withTerminal, as we are now multi-threaded. I am