Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ using `folke/lazy.nvim`
{
"yutkat/git-rebase-auto-diff.nvim",
ft = { "gitrebase" },
opts = {},
opts = {
size = vim.fn.float2nr(vim.o.lines * 0.5),
run_show = false,
},
}
```

Expand Down
9 changes: 7 additions & 2 deletions lua/git-rebase-auto-diff/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local M = {}
local config = {
size = vim.fn.float2nr(vim.o.lines * 0.5),
run_show = false,
}
local buf = nil

Expand Down Expand Up @@ -43,7 +44,11 @@ function M.preview()
if hash == "" then
return
end
require("git-rebase-auto-diff").run("git --no-pager diff " .. hash .. "^!")
local cmd = "git --no-pager diff " .. hash .. "^!"
if config.run_show then
cmd = "git --no-pager show --stat " .. hash .. " && echo '' && " .. cmd
end
require("git-rebase-auto-diff").run(cmd)
end

local function create_autocmds()
Expand Down Expand Up @@ -71,7 +76,7 @@ end

function M.setup(opts)
opts = opts or {}
config = vim.tbl_deep_extend("keep", opts, config)
config = vim.tbl_deep_extend("force", config, opts or {})
create_autocmds()
end

Expand Down
Loading