Skip to content

fix(links): Jump to dedicated link targets - #1199

Merged
seflue merged 1 commit into
nvim-orgmode:masterfrom
seflue:fix/link-dedicated-target
Oct 12, 2026
Merged

seflue merged 1 commit into
nvim-orgmode:masterfrom
seflue:fix/link-dedicated-target

Conversation

@seflue

@seflue seflue commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Links to a dedicated target <<target>> now jump to the target itself, as in Emacs. The whole file is searched for an exact match, with headlines as the fallback.

Before, the link text went into a Lua pattern unescaped, matched by prefix, and only headline sections were searched. So the cursor landed on the headline above the target, [[foo]] also matched <<foobar>>, targets with - or ( in the name were not found, and neither was any target above the first headline.

Specs cover the fixed behavior.

Following a link to a dedicated target moved the cursor to the
enclosing headline instead of the target. The link text was used as
an unescaped Lua pattern and matched target names by prefix, so names
with pattern characters were not found and similar names were
ambiguous. Targets outside any headline section were not searched.

Search the whole file for the first target whose name matches exactly
and case-insensitively, and place the cursor on it, as Emacs does.
Headline titles are still tried when no target matches.

AI-assisted: Claude Code
@seflue
seflue requested a review from kristijanhusak October 11, 2026 22:33
@kristijanhusak

Copy link
Copy Markdown
Member

I think that you should be able to re-run CI by yourself in case it fails. Also approvals means that you can merge it.

@seflue
seflue merged commit 9e4a114 into nvim-orgmode:master Oct 12, 2026
26 of 27 checks passed
@seflue
seflue deleted the fix/link-dedicated-target branch October 13, 2026 18:10
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.

2 participants