Skip to content

feat(buffers): browse directories in editor windows - #370

Merged
fcoury merged 4 commits into
mainfrom
fcoury/directory-browser
Sep 28, 2026
Merged

fcoury merged 4 commits into
mainfrom
fcoury/directory-browser

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Opening a directory with red . currently fails because Red tries to read it as a text file. #368 requests a directory browser that opens as a buffer.

This adds read-only directory buffers for startup paths, :e, open-location requests, and splits. Normal movement and search work on the listing; Enter opens an entry, - goes up, and R or :e! refreshes. Directory paths retain their buffer identity across navigation and sessions, while file saves, LSP, and file watchers continue to see only real text files. The browser reuses NeoTree's scanner; its listing includes hidden and ignored entries. File operations remain available in NeoTree.

Closes #368.

How to Test

  1. Build with cargo build -p red --bin red, then run target/debug/red . from the repository. Dismiss the first-run screen if shown. Expect the current directory, including dotfiles, with . in the breadcrumb and status bar.
  2. Use movement or search to select a folder and press Enter, then open a file. Run :e . and :vs src; both windows should show the expected directory. In the src window, press - to return to the root.
  3. Add a file outside Red, then press R. Both windows displaying that directory should refresh together. Try :w /tmp/red-directory-should-not-exist while in the listing: Red should report that directory buffers are read-only and create no file.
  4. Run cargo test -p red --lib directory_. This covers the new navigation/write-protection and session-restore tests, plus existing NeoTree listing, symlink, and large-directory cases.

Verified locally: 26 targeted tests passed; full cargo clippy --all-targets --all-features -- -D warnings passed; terminal browsing, splits, refresh, and write rejection passed.

@fcoury-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T16:20:11.824538Z 08f1fc8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 08f1fc8882

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/buffer/directory.rs Resolved
@fcoury
fcoury merged commit 195efcb into main Sep 28, 2026
12 checks passed
@fcoury
fcoury deleted the fcoury/directory-browser branch September 28, 2026 16:42
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.

Feature Request: file / directory browser

2 participants