diff --git a/lua/git/cmd.lua b/lua/git/cmd.lua index 7dbad16..803c64d 100644 --- a/lua/git/cmd.lua +++ b/lua/git/cmd.lua @@ -109,13 +109,8 @@ local function run_in_split(worktree, args, conf) end end - -- Bracket naming so the buffer name doesn't pretend to be a real - -- file path (and doesn't collide with the `git://` URI - -- form used by the BufReadCmd loader). Reused on re-run so a - -- second `:G show HEAD` refreshes the existing buffer in place - -- instead of leaving a nameless duplicate behind. local name = "[git " .. table.concat(args, " ") .. "]" - local buf = vim.fn.bufnr(name) + local buf = vim.fn.bufnr("\\V" .. name) if buf == -1 or not vim.api.nvim_buf_is_loaded(buf) then buf = git.new_scratch() pcall(vim.api.nvim_buf_set_name, buf, name)