Repository navigation
fix(preview): find a bare .md name printed from another folder - #66
Merged
Merged
Conversation
`ls docs/` prints `spec.md` relative to docs/, but the name was resolved against the pane's folder, so Ctrl+click reported "file not found". When a bare name is missing there, look below the pane's folder (3 levels, 400 folders, no hidden/dependency folders, no symlinks) and open the single shallowest match; ambiguous names still fail.
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.
What and why
Ctrl+click on a Markdown file name printed by
ls docs/showed "file not found".ls docs/printsspec.mdrelative todocs/, but the name was resolved against the pane's folder, and the output does not say which folder it came from.When a bare name (no
/,\,~or:) is missing from the pane's folder,preview_resolvenow looks below that folder and opens the single shallowest match. The search is bounded: 3 levels, 400 folders, skips hidden folders,node_modules,targetandvendor, and never follows symlinks. Two matches at the same depth stay "file not found" rather than guessing. Names that include a folder resolve as before, and the existing network-path guard (ensure_local) runs before any search.Known gaps: a file more than 3 levels below the pane's folder is still not found.
How you checked it
/cion Windows, all passing:cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(159 passed)pnpm turbo check test build(Vitest 442 passed),pnpm version:checkNot tried by hand in the running app.
cargo fmt --check,cargo clippy -- -D warningsandcargo testpasspnpm turbo check test buildandpnpm version:checkpassBug fixes have a test that failed before the fix (the tests were written together with the fix; I did not run them without it)
No secrets, personal paths or machine names in the diff
Docs and
CHANGELOG.mdupdated if behaviour changed