fix: close side buffers on last main quit#1
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds/reshapes the test suite around zen.setup() behavior and updates LuaDoc typings for configuration to reflect optional inputs.
Changes:
- Replaced the single setup smoke test with three new tests targeting opening/closing/split scenarios.
- Updated
lua/zen/init.luaLuaDoc to make config fields andsetup()options optional. - Removed
tests/test_setup.lua.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_splits.lua |
Adds a new test intended to cover behavior when vertical splits are opened. |
tests/test_opening.lua |
Adds a new test intended to cover side buffers opening on startup. |
tests/test_closing.lua |
Adds a new test intended to cover side buffers closing on quit. |
tests/test_setup.lua |
Removes the prior setup smoke test. |
lua/zen/init.lua |
Adjusts LuaDoc types to mark config/options as optional. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ad85071 to
fd00751
Compare
Agent-Logs-Url: https://github.com/sand4rt/zen.nvim/sessions/ec375353-ede5-4108-8ceb-0ba933b9a808 Co-authored-by: sand4rt <17591696+sand4rt@users.noreply.github.com>
…otations Agent-Logs-Url: https://github.com/sand4rt/zen.nvim/sessions/ec375353-ede5-4108-8ceb-0ba933b9a808 Co-authored-by: sand4rt <17591696+sand4rt@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
lua/zen/init.lua:241
setup()definesConfigOptions(optional user input), but the function is still typed as takingConfigand uses a shallowvim.tbl_extend('force', ...). If a user passesmain = {}/right = {}/left = {}(or misseswidth/min_width), this overwrites defaults and will lead to runtime errors whereopts.main.width/opts[position].min_widthare assumed (e.g.,math.floor((vim.o.columns - opts.main.width)/2)). Change the param type toConfigOptionsand use a deep-merge/defaulting strategy so required internal fields remain present after merging.
---@param options? Config
local function setup(options)
-- Default splitting will cause your main splits to jump when opening an integration.
-- To prevent this, set `splitkeep` to either `screen` or `topline`.
vim.opt.splitkeep = "screen"
---@type Config
opts = vim.tbl_extend("force", opts, options or {})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.