feat(git): navigate any git object from cat-file headers

This commit is contained in:
2026-04-28 13:55:33 +02:00
parent 68f2ad1b52
commit 03c6cb9ddc
2 changed files with 19 additions and 9 deletions
+7 -1
View File
@@ -119,7 +119,13 @@ local function run_in_split(worktree, args, conf)
vim.b[buf].git_parent_ref =
repo.rev_parse(worktree, user_ref .. "^", true)
end
pcall(vim.api.nvim_buf_set_name, buf, "git://" .. (sha or user_ref))
-- Per-subcommand scheme so `:G show <sha>` doesn't collide with
-- the cat-file URI form `git://<sha>` used by the gitlog flow.
pcall(
vim.api.nvim_buf_set_name,
buf,
"git" .. args[1] .. "://" .. (sha or user_ref)
)
vim.bo[buf].filetype = conf.ft
else
vim.bo[buf].filetype = conf.ft