refactor(git): promote set_buf_name_and_filetype to diff.M
This commit is contained in:
+1
-5
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user