feat(hover): peek full URL on mouse hover over links#19
Merged
Conversation
Set up a <MouseMove>-driven floating window that shows the full URL while the mouse hovers over a link in a md-render preview. Truncates to half the editor width, sits just above any statusline/cmdline, and uses Comment hl with winblend so it stays out of the way of the document body. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
lua/md-render/url_hover.lua: while the mouse hovers a link inside a md-render preview, the full URL appears in a small floating window pinned to the bottom-right of the editor.cmdheight+laststatus(incl. globallaststatus=3and per-tablaststatus=1) so it never overlaps the cmdline or statusline.border=none,winblend=15,Normal:Comment— subtle by design. Long URLs are truncated to half the editor width with a…suffix.<MouseMove>keymap (the autocmd event by that name doesn't exist) with'mousemoveevent'auto-enabled on first attach. 100 ms debounce so quick mouse moves don't flicker.setup_float_keymaps, so the hover works in every preview surface (floating preview, render-mode toggle buffer, demo window).Tests cover URL truncation (incl. CJK width), extmark hit-testing, hover window lifecycle, attach/detach, and the new
bottom_reserved_rowscalculation across alllaststatus/cmdheightcombinations.Test plan
make test— 32 new assertions intests/url_hover_test.lua; 0 regressions in the existing suite (557 total).laststatus=2and the cmdline atcmdheight=1.🤖 Generated with Claude Code