Skip to content

Commit 9e9a830

Browse files
authored
fix: tabs close (#10)
1 parent 5770f43 commit 9e9a830

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎lua/zen/init.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ local function setup(options)
316316
end
317317

318318
local editable_count = 0
319-
for _, win in ipairs(vim.api.nvim_list_wins()) do
319+
for _, win in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
320320
if not is_popup_window(win) then
321321
local buf = vim.api.nvim_win_get_buf(win)
322322
if not is_buff_integration(buf) then

‎tests/test_tabs.lua‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,19 @@ T["open zen side buffers on a new tab"] = function()
2323
})
2424
end
2525

26+
27+
T["close tab on last main quit"] = function()
28+
child.cmd("tabnew")
29+
child.cmd("q")
30+
31+
Helpers.expect.layout(child, {
32+
type = "row",
33+
children = {
34+
{ type = "leaf", filetype = "zen-left", buftype = "nofile", width = 46, height = 50 },
35+
{ type = "leaf", filetype = "", buftype = "", width = 146, height = 50 },
36+
{ type = "leaf", filetype = "zen-right", buftype = "nofile", width = 46, height = 50 },
37+
},
38+
})
39+
end
40+
2641
return T

0 commit comments

Comments
 (0)