fix: close side buffers when splitting current buffer - #28
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, consistent with existing autocmd logic, and includes a focused regression test for the reported scenario.
Pull request overview
This PR fixes a Zen side-buffer visibility bug when users split the current buffer via plain :vsplit, by ensuring the same “multiple vsplits” closure logic runs on WinNew (not just BufWinEnter). It also adds a regression test to cover the previously failing scenario.
Changes:
- Extend the existing autocmd logic to also handle
WinNew, ensuring side buffers close when splitting the current buffer. - Add a regression test for
:vsplitwith no target file (splitting the current buffer).
File summaries
| File | Description |
|---|---|
lua/zen/init.lua |
Adds WinNew handling to trigger the existing split-detection/side-buffer close logic for current-buffer splits. |
tests/test_splits.lua |
Adds a regression test verifying :vsplit (without a file arg) closes Zen side buffers. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Owner
|
Thanks! |
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.
Hi! I ran into an issue where running plain
:vsplitwasn't hiding Zen's side buffers. This PR fixes that by handlingWinNewthrough the same split logic as the existingBufWinEnterpath (alongside a regression test).zen.nvimhas been great otherwise -- thanks for building it!