-
Notifications
You must be signed in to change notification settings - Fork 197
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: Buffer with this name already exists after manually closing neo-tree #1415
Labels
bug
Something isn't working
Comments
Note that I've managed to workaround this problem by adding this event handle: {
event = 'neo_tree_buffer_leave',
handler = function()
local shown_buffers = {}
for _, win in ipairs(vim.api.nvim_list_wins()) do
shown_buffers[vim.api.nvim_win_get_buf(win)] = true
end
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if not shown_buffers[buf] and vim.api.nvim_buf_get_option(buf, 'buftype') == 'nofile' and vim.api.nvim_buf_get_option(buf, 'filetype') == 'neo-tree' then
vim.api.nvim_buf_delete(buf, {})
end
end
end,
}, But this, of course, is an ugly hack. |
@idanarye Its working, haha... Will use this for a while |
pysan3
changed the title
BUG:
BUG: Buffer with this name already exists after manually closing neo-tree
Mar 27, 2024
pysan3
added a commit
to pysan3/neo-tree.nvim
that referenced
this issue
Mar 27, 2024
Regarding how to reproduce the issue: |
3 tasks
+1 same here, error persists even after adding the above function into |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you check docs and existing issues?
Neovim Version (nvim -v)
0.9.5
Operating System / Version
Arch Linux 6.7.0-arch3-1
Describe the Bug
This looks similar to #1365, but since I don't use sessions (the discussion there is mostly about how fix it by fixing session management with a new
)auto_restore_session_experimental = true
setting) and since I've only started experiencing this a couple of days ago (that ticket is almost a month old), I suspect it may be a different bug.When closing the Neo-tree panel using Vim commands (like
:quit
or like running:only
from another window), another attempt to open the Neo-tree panel will result in aBuffer with this name already exists
error.Note that when I close the panel using Neo-tree (e.g. - by hitting
q
inside it) this problem does not occur.Screenshots, Traceback
Steps to Reproduce
:Neotree
to open the Neo-tree panel.:close
inside the Neo-tree panel to close it (don't use any of Neo-tree's shortcuts/commands for closing the panel - use Vim's window management commands):Neotree
again.Expected Behavior
I'd expect the Neo-tree panel to just open again.
Your Configuration
The text was updated successfully, but these errors were encountered: