Skip to content

feat(hover): peek full URL on mouse hover over links#19

Merged
delphinus merged 1 commit into
mainfrom
feat/url-hover
May 26, 2026
Merged

feat(hover): peek full URL on mouse hover over links#19
delphinus merged 1 commit into
mainfrom
feat/url-hover

Conversation

@delphinus
Copy link
Copy Markdown
Owner

Summary

  • New 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.
  • Position is computed from cmdheight + laststatus (incl. global laststatus=3 and per-tab laststatus=1) so it never overlaps the cmdline or statusline.
  • Visual style: border=none, winblend=15, Normal:Comment — subtle by design. Long URLs are truncated to half the editor width with a suffix.
  • Mechanism: <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.
  • Wired into 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_rows calculation across all laststatus/cmdheight combinations.

Test plan

  • make test — 32 new assertions in tests/url_hover_test.lua; 0 regressions in the existing suite (557 total).
  • Manual: open a Markdown preview, hover over a link → full URL appears at the bottom-right; mouse-off → it disappears. Verify it does not overlap the statusline at laststatus=2 and the cmdline at cmdheight=1.

🤖 Generated with Claude Code

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>
@delphinus delphinus merged commit f9792d4 into main May 26, 2026
4 checks passed
@delphinus delphinus deleted the feat/url-hover branch May 26, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant