mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-18 01:34:32 +02:00
feat(snacks): use terminal
This commit is contained in:
parent
45acfaacb5
commit
ad9d3d19b1
9 changed files with 77 additions and 89 deletions
|
@ -148,19 +148,22 @@ end
|
|||
function M.blame_line(opts)
|
||||
opts = vim.tbl_deep_extend("force", {
|
||||
count = 3,
|
||||
filetype = "git",
|
||||
size = {
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
interactive = false,
|
||||
float = {
|
||||
win = {
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
border = "rounded",
|
||||
},
|
||||
bo = { filetype = "git" },
|
||||
},
|
||||
border = "rounded",
|
||||
}, 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 require("lazy.util").float_cmd(cmd, opts)
|
||||
return Snacks.terminal(cmd, opts)
|
||||
end
|
||||
|
||||
-- stylua: ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue