Skip to content

fix: close side buffers on last main quit#1

Merged
sand4rt merged 4 commits into
mainfrom
more-tests
Apr 12, 2026
Merged

fix: close side buffers on last main quit#1
sand4rt merged 4 commits into
mainfrom
more-tests

Conversation

@sand4rt

@sand4rt sand4rt commented Apr 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 12, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.lua LuaDoc to make config fields and setup() 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.

Comment thread tests/test_splits.lua Outdated
Comment thread tests/test_splits.lua Outdated
Comment thread tests/test_opening.lua Outdated
Comment thread tests/test_closing.lua Outdated
Comment thread tests/test_closing.lua Outdated
Comment thread lua/zen/init.lua Outdated
Comment thread lua/zen/init.lua Outdated
@sand4rt sand4rt force-pushed the more-tests branch 2 times, most recently from ad85071 to fd00751 Compare April 12, 2026 12:27
@sand4rt sand4rt changed the title test: improve coverage fix: close side buffers on last main quit Apr 12, 2026
Copilot AI review requested due to automatic review settings April 12, 2026 12:33
@sand4rt sand4rt review requested due to automatic review settings April 12, 2026 12:33
Copilot AI review requested due to automatic review settings April 12, 2026 12:33
@sand4rt sand4rt review requested due to automatic review settings April 12, 2026 12:33
Copilot AI review requested due to automatic review settings April 12, 2026 12:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() defines ConfigOptions (optional user input), but the function is still typed as taking Config and uses a shallow vim.tbl_extend('force', ...). If a user passes main = {} / right = {} / left = {} (or misses width/min_width), this overwrites defaults and will lead to runtime errors where opts.main.width/opts[position].min_width are assumed (e.g., math.floor((vim.o.columns - opts.main.width)/2)). Change the param type to ConfigOptions and 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.

Comment thread lua/zen/init.lua
Comment thread lua/zen/init.lua Outdated
Comment thread tests/test_closing.lua Outdated
@sand4rt sand4rt merged commit efcd924 into main Apr 12, 2026
2 checks passed
@sand4rt sand4rt deleted the more-tests branch April 12, 2026 12:58
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.

3 participants