refactor(git): centralize registrations, defer submodule loads
This commit is contained in:
@@ -185,31 +185,4 @@ function M.split(opts)
|
||||
place_pair(buf, cur_buf, true, opts.vertical)
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
local function diff_split_cmd(vertical)
|
||||
return function(opts)
|
||||
M.split({
|
||||
rev = opts.args ~= "" and opts.args or nil,
|
||||
vertical = vertical,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
"Gdiffsplit",
|
||||
diff_split_cmd(true),
|
||||
{ nargs = "?", desc = "Diff against <rev>" }
|
||||
)
|
||||
vim.api.nvim_create_user_command(
|
||||
"Gvdiffsplit",
|
||||
diff_split_cmd(true),
|
||||
{ nargs = "?", desc = "Diff against <rev> (vertical split)" }
|
||||
)
|
||||
vim.api.nvim_create_user_command(
|
||||
"Ghdiffsplit",
|
||||
diff_split_cmd(false),
|
||||
{ nargs = "?", desc = "Diff against <rev> (horizontal split)" }
|
||||
)
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user