Repository navigation
fix(nvim): resolve Windows absolute markdown link paths - #196
Merged
Merged
Conversation
resolve_path treated a link target as absolute only when it started with '/', so on Windows a target like C:\notes\a.md was joined onto the buffer's directory and never found. Peek (<leader>gp), the outline previewer and gf all went through it, and the test 'opens linked markdown files in a floating preview buffer' failed on Windows (it links to a vim.fn.tempname() path) while passing on Linux CI. Use vim.fn.isabsolutepath, which accepts drive-letter and UNC paths on Windows and keeps '/'-rooted paths absolute on every platform. Co-Authored-By: Claude Opus 5.5 <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.
Why the change
On Windows, markdown links to absolute paths like
C:\notes\a.mdwere joined onto the buffer's folder and never found, so peek, the outline preview andgffailed on them; now they resolve like/-rooted paths do.Special things to note
opens linked markdown files in a floating preview buffer) that failed on Windows and passed in CI: it links to avim.fn.tempname()path.isabsolutepath('C:\…')is 0 there), so the existing test on a Windows machine is the coverage. All 39 nvim tests pass locally on Windows.Change outline
resolve_pathindot_config/nvim/lua/custom/markdown_nav.lua, both absolute checks:vim.fn.isabsolutepathon Windows (nvim 0.12.6):C:\x\y.md→ 1,C:/x/y.md→ 1,/x/y.md→ 1,docs/a.md→ 0.🤖 Generated with Claude Code