Closed beaumccartney closed 2 months ago
this only happens on the nightly branch. easiest way i found to get there was to not clone with depth=1 and just check it out manually
No worries, I found the issue.
this is also happening after upgrading to neovim 0.10, thanks @CKolkey in advance and looking forward for the fix
Yes, I am having the same problem and it started when I upgraded to Neovim 0.10 (but it can be a coincidence). The temporary solution was to change kind
to replace
.
I am also having this issue.
The temporary solution was to change
kind
toreplace
.
This only seems to help for the main neogit instance. If you e.g. open the commit editor, it still creates a blank buffer.
Me toooo. Hope be solved soon~ :D
Same, I tried the replace thing but it doesn't matter if you are doing a lot of git stuff as it creates buffers for anything you do inside Neogit.
keymap('n', '<leader>b.', function()
local buffers = vim.api.nvim_list_bufs()
for _, buf in ipairs(buffers) do
if vim.api.nvim_buf_is_valid(buf) then
local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false)
if #lines == 1 and #lines[1] == 0 then
-- Buffer is empty, delete it
vim.api.nvim_buf_delete(buf, { force = true })
end
end
end
end, { desc = "Delete all empty buffer", noremap = true, silent = true })
for emergency. :D
If anyone still experiences this issue with the above fix merged, please let me know here. That said, I can reproduce the no name
issue before, but not after, that patch.
@CKolkey same behavior after update
Shoot, really? With all kinds (split, tab, etc), or one specifically?
Still experiencing the same issue with no name buffers. I am using the default tab one
kind=tab
Are you both using a buffer-line plugin? I'm using :buffers
to check this.
I use tabby.nvim
I am using bufferline and I am experiencing the same. Note that most empty buffers are gone; only the one from the main neogit instance is hanging about.
Note that most empty buffers are gone; only the one from the main neogit instance is hanging about.
![]()
@qRoC Are you using any special kind
, or the default? In my case where I'm getting an empty buffer for the main tab only, I'm using defaults for all except:
commit_editor = {
kind = "vsplit"
}
default
Ahh, I can in fact reproduce every time I open a new tab, e.g. log_view
etc, apologies.
I am using default kind (tab), and I have lualine for my buffers, removing the setting to displaying buffer from lualine config still shows empty buffers being created. when I search buffers via telescope. For me nothing changed I still see buffers being created whenever I do any git related stuff inside neogit.
If someone could give this branch a try and let me know if the issue persists for them, I'd appreciate it :) https://github.com/NeogitOrg/neogit/pull/1326
unfortunately for me it's still behaving the same way on that branch
If someone could give this branch a try and let me know if the issue persists for them, I'd appreciate it :) #1326
Sorry to say but yes I'm still having the same issues :(
Thank you for all your efforts, it's appreciated!
I tried setting up both Tabby and https://github.com/akinsho/bufferline.nvim and can't get it to show any noname buffers :\
Also tried with a very very minimal config and can't reproduce.
Happy to keep trying to fix this, but I think at this point I need a minimal reproduction config to actually work on it. If someone wants to make that, then I'll do what I can to fix it :)
Here is mine, and for what it's worth, I'm on macOS.
require("neogit").setup {
use_default_keymaps = true,
integrations = {
diffview = false,
},
commit_editor = {
kind = "vsplit",
show_staged_diff = false,
staged_diff_split_kind = "split"
},
}
Alright, found a way to reproduce it! Thanks for the help, I'll try to fix this tonight after the kiddo is asleep
~Here, the new commit does not create anymore the empty buffer when opening the popup, but it does show if we open the commit message buffer.~
Sorry, I posted before reading the new comments. The problem here continues if kind = tab
.
I'm also having this issue with bufferline enabled on last update Disabling bufferline solves it (os - windows, kind - default, neovim 0.10)
@CKolkey thanks for trying to fix it
@CKolkey the empty buffer seems to be created by tabnew. Replacing the call of tabnew (in Buffer:show()
) with tab sb <bufno>
solved the problem for me.
diff --git a/lua/neogit/lib/buffer.lua b/lua/neogit/lib/buffer.lua
index 42c14789..c70f522e 100644
--- a/lua/neogit/lib/buffer.lua
+++ b/lua/neogit/lib/buffer.lua
@@ -258,8 +258,7 @@ function Buffer:show()
api.nvim_set_current_buf(self.handle)
win = api.nvim_get_current_win()
elseif kind == "tab" then
- vim.cmd("tabnew")
- api.nvim_set_current_buf(self.handle)
+ vim.cmd("tab sb " .. self.handle)
win = api.nvim_get_current_win()
elseif kind == "split" then
win = api.nvim_open_win(self.handle, true, { split = "below" })
the fix from @iH8c0ff33 also solved the problem for me.
Awesome - I'll have it shipped in a few minutes. Thank you @iH8c0ff33 !
@CKolkey new problem :)
Neogit
- this create new tabhttps://github.com/NeogitOrg/neogit/assets/1789565/a4dcad38-7233-413b-9a2b-7f623b7cff31
depends on CWD
guys, I've got a 2 year old and my wife is pregnant - feel free to submit a PR 😅
Anyways, I appreciate the patience otherwise :)
The fix works for me. No any empty buffers. 👍🏻
Description
opening neogit adds an empty buffer, closing neogit doesn't remove this buffer. they accumulate during use of neogit. especially problematic with tabs or other UI that works with buffers
Neovim version
NVIM v0.10.0-dev-3107+g8c7a8be27 Build type: RelWithDebInfo LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info
Operating system and version
macos 14.4.1
Steps to reproduce
open neovim with any minimal repro (including the one provided by the issue template)
:Neogit
then close with q or any other way:buffers
shows a no name buffer, keep opening neogit to add more buffersExpected behavior
no accumulation of no name buffers
Actual behavior
accumulation of no name buffers
Minimal config