mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-18 01:34:32 +02:00
feat(snacks): use git
This commit is contained in:
parent
676e700ca0
commit
ad698dd0aa
2 changed files with 2 additions and 23 deletions
|
@ -1,25 +1,5 @@
|
|||
---@class lazyvim.util.lazygit
|
||||
---@param opts? {count?: number}|LazyCmdOptions
|
||||
function M.blame_line(opts)
|
||||
opts = vim.tbl_deep_extend("force", {
|
||||
count = 3,
|
||||
interactive = false,
|
||||
float = {
|
||||
win = {
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
border = "rounded",
|
||||
},
|
||||
bo = { filetype = "git" },
|
||||
},
|
||||
}, opts or {})
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
local line = cursor[1]
|
||||
local file = vim.api.nvim_buf_get_name(0)
|
||||
local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] or "."
|
||||
local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
||||
return Snacks.terminal(cmd, opts)
|
||||
end
|
||||
local M = {}
|
||||
|
||||
-- stylua: ignore
|
||||
M.remote_patterns = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue