Skip to content

fix: open integration when the window is small - #26

Closed
sand4rt wants to merge 3 commits into
mainfrom
fix-open-in-small-window
Closed

fix: open integration when the window is small#26
sand4rt wants to merge 3 commits into
mainfrom
fix-open-in-small-window

Conversation

@sand4rt

@sand4rt sand4rt commented Aug 23, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 23, 2026 13:18
@sand4rt

sand4rt commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

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.

🟡 Changes recommended

Boundary handling and swallowed resize errors remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes integration opening in narrow Neovim windows and adds regression coverage.

Changes:

  • Guards narrow-window resizing and stack repositioning.
  • Adds small-window and stack regression tests.
  • Adds a narrow-window test configuration.
File summaries
File Summary
tests/test_integrations.lua Adds integration layout regression tests.
tests/scripts/init_with_zen_small.lua Configures the narrow-window test environment.
lua/zen/init.lua Updates narrow-window resizing and stack repositioning.
Review details

Suppressed comments (1)

lua/zen/init.lua:376

  • This guard does not cover the min-width adjustment in the BufWinEnter/FileType callback: when a configured integration has min_width and vim.o.columns <= get_main_width(), that path still calls nvim_win_set_width(..., min_width). On a terminal narrower than the configured minimum, the requested width cannot fit and the integration can fail to open. Apply the small-window rule around that adjustment too, and keep a min-width regression case.
			if vim.o.columns <= get_main_width() then
				return
			end
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lua/zen/init.lua
vim.api.nvim_create_autocmd("CursorMoved", {
-- TODO: use pattern for better perf
callback = function(args)
if vim.o.columns <= get_main_width() then
Comment thread lua/zen/init.lua
Comment on lines +284 to +288
pcall(function()
if position == "top" then
vim.api.nvim_win_set_config(windows[1], { split = "above", win = -1 })
for i = 2, #windows do
vim.api.nvim_win_set_config(windows[i], { split = "below", win = windows[i - 1] })
Co-authored-by: sand4rt <17591696+sand4rt@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 23, 2026 13:25

Copilot AI commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 2e122bf.

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.

🟡 Changes recommended

The functional fix described by the PR title is not included.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • Review effort level: Lite



for _, case in ipairs({ { name = "above", }, { name = "below", } }) do
for _, case in ipairs({ { name = "above" }, { name = "below" } }) do
Copilot AI review requested due to automatic review settings August 23, 2026 13:28

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.

🟡 Changes recommended

The small-window behavior remains unchanged and needs an implementation plus regression coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

tests/test_integrations.lua:134

  • The PR is titled as a fix for opening integrations in a small window, but this change only removes whitespace and reformats the test-case table; it does not alter the integration-opening logic or add a small-window regression test. Please include the runtime fix and a focused test, or retitle this PR if it is intended to be formatting-only.
for _, case in ipairs({ { name = "above" }, { name = "below" } }) do
  • Files reviewed: 1/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread lua/zen/init.lua
--- @field filetype Filetype
--- @field min_width? number
--- @field replace? boolean
--- @field replace? boolean
@sand4rt sand4rt closed this Aug 23, 2026
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