refactor(git): promote set_buf_name_and_filetype to diff.M

This commit is contained in:
2026-04-27 13:53:12 +02:00
parent 49e0ac726e
commit 5833323814
3 changed files with 8 additions and 12 deletions
+1 -5
View File
@@ -94,11 +94,7 @@ local function blob_buf(worktree, blob, path, ref)
end
---@cast blob string
local buf = diff.git_show_blob(worktree, blob)
pcall(vim.api.nvim_buf_set_name, buf, "git://" .. ref .. "/" .. path)
local ft = vim.filetype.match({ buf = buf })
if ft then
vim.bo[buf].filetype = ft
end
diff.set_buf_name_and_filetype(buf, "git://" .. ref .. "/" .. path)
return buf
end