hints: Show the hovered link target in a bottom-left pill - #1864
Open
aymanbagabas wants to merge 1 commit into
Open
hints: Show the hovered link target in a bottom-left pill#1864aymanbagabas wants to merge 1 commit into
aymanbagabas wants to merge 1 commit into
Conversation
aymanbagabas
force-pushed
the
hint-target-tooltip
branch
2 times, most recently
from
August 12, 2026 11:20
8b74439 to
45b7280
Compare
Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>
aymanbagabas
force-pushed
the
hint-target-tooltip
branch
from
August 12, 2026 22:43
a19adba to
b299cdf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased onto main now that #1869 has landed, so the diff is the pill alone, one commit against current main.
An OSC 8 link's display text is arbitrary, so its destination stays invisible until you have already opened it. This puts the target in a pill at the bottom-left while the link is hovered, the way a browser status bar does.
Renderer::runalready holds the sugarloaf handle and the resolved match text inrenderable_content.highlighted_hint, so the whole feature is onerounded_rectplus onetext_mut().drawnext to the existingsearch.render, reusing that overlay's primitives and draw order. Rendering is immediate mode, so a frame that does not draw the pill is a frame without one and there is no visibility state to leak. No new file, no struct, no config key, no dependency.The pill is gated on the click actually landing, not merely on a hint being highlighted.
highlighted_hintis recomputed only on cell crossings and modifier changes, so it survives an overlay opening on top of it, and the search overlay, command palette, assistant and quit confirmation each consume the click before the hint handler runs. Advertising a target that cannot be opened would be a lie, so the check runs per frame. This is also why the change belongs above #1863: without it a click in mouse mode never reaches the hint at all.Truncation keeps the head rather than the tail, the opposite of what
search.rsdoes for its input field, because a URL's scheme and host are what tell you where the click lands.elide_tailtakes its measuring function as a parameter, so the binary search is unit tested against a fixed-width stand-in: an off-by-one sweep across every budget from 1 to 39, the zero-width case, and a multibyte string proving the slicing lands on char boundaries.Verified by hovering a real OSC 8 link whose display text differs from its URI: the pill appears with the destination, and does not appear when nothing is hovered.
Release Notes: