#1184 only close the current tabpage (#1188)

This commit is contained in:
Alexander Courtis 2022-04-24 19:15:47 +10:00 committed by GitHub
parent bf467a7cf4
commit 74ae97098f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -357,7 +357,12 @@ function M._prevent_buffer_override()
local curbuf = a.nvim_win_get_buf(curwin)
local bufname = a.nvim_buf_get_name(curbuf)
if not bufname:match "NvimTree" then
M.View.tabpages = {}
for i, tabpage in ipairs(M.View.tabpages) do
if tabpage.winnr == view_winnr then
M.View.tabpages[i] = nil
break
end
end
end
if curwin ~= view_winnr or bufname == "" or curbuf == view_bufnr then
return