From fe7986f6c83ef838fc4c1973c6660f834ee5f085 Mon Sep 17 00:00:00 2001 From: themanyone Date: Wed, 27 May 2026 20:59:19 -0800 Subject: [PATCH] enh: visit nearest available link by default --- ui/pager.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/pager.go b/ui/pager.go index 3cb9380..aa124da 100644 --- a/ui/pager.go +++ b/ui/pager.go @@ -254,6 +254,16 @@ func (m pagerModel) update(msg tea.Msg) (pagerModel, tea.Cmd) { return m, cmd } if len(m.links) > 0 { + // No link selected. Just visit the nearest visible link. + body := strings.TrimSpace(m.currentDocument.Body) + for i, l := range m.links { + if strings.Contains(body, l.Label) { + m.focusedLink = i + cmd := m.followFocusedLink() + return m, cmd + } + } + cmds = append(cmds, m.showStatusMessage(pagerStatusMessage{"Tab to select a link", false})) }