We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60d37f7 commit 500d8b2Copy full SHA for 500d8b2
lua/diffview/ui/panel.lua
@@ -304,10 +304,13 @@ end
304
function Panel:close()
305
if self:is_open() then
306
local num_wins = api.nvim_tabpage_list_wins(api.nvim_win_get_tabpage(self.winid))
307
+
308
if #num_wins == 1 then
309
-- Ensure that the tabpage doesn't close if the panel is the last window.
- vim.cmd("sp")
310
- File.load_null_buffer(0)
+ api.nvim_win_call(self.winid, function()
311
+ vim.cmd("sp")
312
+ File.load_null_buffer(0)
313
+ end)
314
elseif self:is_focused() then
315
vim.cmd("wincmd p")
316
end
0 commit comments