refactor(git): scratch buffers wipe by default, consolidate factories in util

This commit is contained in:
2026-04-29 10:39:48 +02:00
parent 0766c7f11e
commit 18b198f293
6 changed files with 48 additions and 54 deletions
+3 -1
View File
@@ -41,7 +41,9 @@ function M.show(opts)
return
end
local buf = util.new_scratch()
-- `hide` keeps the log around when the user navigates into a commit
-- via `<CR>` (which replaces the current buffer); `<C-^>` jumps back.
local buf = util.new_scratch({ bufhidden = "hide" })
vim.b[buf].git_worktree = worktree
vim.bo[buf].modifiable = true
vim.api.nvim_buf_set_lines(buf, 0, -1, false, util.split_lines(stdout))