Skip to content

feat: sort markdown files by directory depth - #959

Open
officialasishkumar wants to merge 1 commit into
charmbracelet:masterfrom
officialasishkumar:feat/distance-sort-markdown
Open

feat: sort markdown files by directory depth#959
officialasishkumar wants to merge 1 commit into
charmbracelet:masterfrom
officialasishkumar:feat/distance-sort-markdown

Conversation

@officialasishkumar

Copy link
Copy Markdown

Summary

Sorts discovered TUI markdown files by directory depth before path/title ordering.

This keeps files in the directory where Glow is browsing ahead of files in nested folders, while preserving the existing alphabetical path sort for files at the same depth.

Testing

  • go test ./...
  • go test -race -covermode atomic ./...
  • git diff --check

Fixes #272

The TUI file list sorted purely by note path, so markdown files in child directories could appear before files in the directory where Glow was launched.

Rank discovered files by path depth first, then preserve the existing path sort within each depth so root-level documents are listed before nested documents.

Fixes charmbracelet#272
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.

Sort discovered markdown files by distance to working directory

1 participant