refactor(git/log): use bufhidden=delete for log buffers

This commit is contained in:
2026-05-07 23:17:49 +02:00
parent 4677da16cc
commit 93c9b6500a
+3 -4
View File
@@ -13,9 +13,8 @@ local cr = vim.api.nvim_replace_termcodes("<CR>", true, false, true)
local function attach_dispatch(buf) local function attach_dispatch(buf)
vim.keymap.set("n", "<CR>", function() vim.keymap.set("n", "<CR>", function()
local r = repo.resolve(buf) local r = repo.resolve(buf)
-- Anchor past the leading graph chars (matches the leading sha -- Anchor past the leading graph chars (matches the leading sha column,
-- column, not any hex word that happens to appear later in the -- not any hex word that happens to appear later in the subject).
-- subject).
local sha = r local sha = r
and vim.api and vim.api
.nvim_get_current_line() .nvim_get_current_line()
@@ -99,7 +98,7 @@ function M.read_uri(buf)
repo.bind(buf, r) repo.bind(buf, r)
vim.bo[buf].swapfile = false vim.bo[buf].swapfile = false
vim.bo[buf].bufhidden = "hide" vim.bo[buf].bufhidden = "delete"
vim.bo[buf].buftype = "nofile" vim.bo[buf].buftype = "nofile"
vim.bo[buf].modifiable = false vim.bo[buf].modifiable = false
if vim.bo[buf].filetype ~= "gitlog" then if vim.bo[buf].filetype ~= "gitlog" then