-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] When closing dbee window, previous tab is changed to empty buffer #120
Comments
I have the same problem, when I open more than 1 tab, it closed any last tab I have Screen.Recording.2024-07-02.222059.mp4I have tab 1,2,3 then when I open nvim-dbee and close it, also posting Discord discussion link with AstroNvim creator that think there is bad tab management things and it's close function |
Here is a reproducing minimal configuration: -- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"kndndrj/nvim-dbee",
dependencies = {
"MunifTanjim/nui.nvim",
},
build = function()
-- Install tries to automatically detect the install method.
-- if it fails, try calling it with one of these parameters:
-- "curl", "wget", "bitsadmin", "go"
require("dbee").install()
end,
config = function()
require("dbee").setup(--[[optional config]])
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
}) Steps to Reproduce
|
Same issue, overall dbee is trying to restore the old layout, but defaulting to restoring the layout and such is probably assuming too much. There is a small work around you can override the default close function like so local layouts = require("dbee.layouts")
function layouts.Default:close()
for _, win in ipairs(self.windows) do
pcall(vim.api.nvim_win_close, win, false)
end
self.is_opened = false
end OR local tools = require("dbee.layouts.tools")
local noop = function() return nil end
tools.save = noop
tools.restore = noop |
Steps to reproduce:
:tabnew
):q
)Expected outcome:
All relevant buffers are closed correctly, and you are either left with whatever was open before you opened db or the other tab.
Actual outcome:
tab with dbee is closed, the first tab is change to a single empty buffer (even if there were multiple splits open before).
The text was updated successfully, but these errors were encountered: