Skip to content

feat(buffers): add unnamed buffer creation - #299

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/enew
Aug 21, 2026
Merged

fcoury-oai merged 2 commits into
mainfrom
fcoury/enew

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Red currently has no equivalent of Vim's :enew, so starting an empty scratch document requires choosing a filename or disturbing the existing editor state.

Add an unnamed-buffer action exposed through both :enew and the command palette. The command preserves unsaved buffers, reuses an already-clean empty unnamed buffer, changes only the active split, and rejects filename arguments. Document the new behavior in docs/VIM_COMPATIBILITY.md.

How to Test

  1. Open an existing file, modify it without saving, and run :enew. Confirm the active window displays a clean [No Name] buffer, then switch back and confirm the original changes remain unsaved and the file on disk is unchanged.
  2. Run :enew again while the empty unnamed buffer is active; confirm no additional buffer is created. Run :enew unexpected.txt; confirm it reports usage: enew without changing buffers.
  3. Run cargo test --test editing enew and cargo test --lib palette_exposes_the_unnamed_buffer_command; expect the four editing regressions and the command-palette regression to pass.

@fcoury-oai
fcoury-oai merged commit 8d86c47 into main Aug 21, 2026
12 checks passed
@fcoury-oai
fcoury-oai deleted the fcoury/enew branch August 21, 2026 21:54
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.

1 participant