@@ -61,6 +61,20 @@ T["left integration"]["opening an integration should close the existing integrat
6161 })
6262end
6363
64+ T [" left integration" ][" opening an integration on a small window" ] = function ()
65+ child .restart ({ " -u" , " tests/scripts/init_with_zen_small.lua" })
66+
67+ child .cmd (" Fyler kind=split_left_most" )
68+
69+ Helpers .expect .layout (child , {
70+ type = " row" ,
71+ children = {
72+ { type = " leaf" , filetype = " fyler_finder" , buftype = " acwrite" , width = 35 , height = 50 },
73+ { type = " leaf" , filetype = " " , buftype = " " , width = 104 , height = 50 },
74+ },
75+ })
76+ end
77+
6478T [" top integration" ] = MiniTest .new_set ({})
6579
6680T [" top integration" ][" opening" ] = function ()
@@ -202,6 +216,46 @@ for _, case in ipairs({ { name = "above", }, { name = "below", } }) do
202216 end
203217end
204218
219+ T [" top integration" ][" closing a git commit keeps the top and bottom stacks intact" ] = function ()
220+ -- Regression: creating a commit in fugitive and then closing the gitcommit
221+ -- window used to abort the reposition handlers with `E242: Can't split a
222+ -- window while closing another`, because recreating a side buffer on
223+ -- `WinClosed` re-enters `reposition_stack` mid-close. The close must leave
224+ -- the fugitive (top) and trouble (bottom) stacks intact instead.
225+ child .lua ([[
226+ local tmpdir = vim.fn.tempname()
227+ vim.fn.mkdir(tmpdir, "p")
228+ vim.fn.system({ "git", "init", tmpdir })
229+ vim.fn.system({ "git", "-C", tmpdir, "config", "user.name", "Test" })
230+ vim.fn.system({ "git", "-C", tmpdir, "config", "user.email", "test@test.com" })
231+ vim.fn.system({ "git", "-C", tmpdir, "commit", "--allow-empty", "-m", "initial" })
232+ vim.fn.writefile({ "hello" }, tmpdir .. "/file")
233+ vim.cmd("edit " .. tmpdir .. "/file")
234+ ]] )
235+
236+ child .cmd (" Git" )
237+ child .cmd (" Trouble diagnostics" )
238+ child .cmd (" wincmd t" )
239+ child .cmd (" Git commit --allow-empty" )
240+ child .cmd (" q" )
241+
242+ Helpers .expect .layout (child , {
243+ type = " col" ,
244+ children = {
245+ { type = " leaf" , filetype = " fugitive" , buftype = " nowrite" , width = 240 , height = 25 },
246+ {
247+ type = " row" ,
248+ children = {
249+ { type = " leaf" , filetype = " zen-left" , buftype = " nofile" , width = 46 , height = 13 },
250+ { type = " leaf" , filetype = " " , buftype = " " , width = 146 , height = 13 },
251+ { type = " leaf" , filetype = " zen-right" , buftype = " nofile" , width = 46 , height = 13 },
252+ },
253+ },
254+ { type = " leaf" , filetype = " trouble" , buftype = " nofile" , width = 240 , height = 10 },
255+ },
256+ })
257+ end
258+
205259T [" bottom integration" ] = MiniTest .new_set ({})
206260
207261T [" bottom integration" ][" opening" ] = function ()
0 commit comments