fix: warn for inapplicable git commands
This commit is contained in:
@@ -172,7 +172,7 @@ function M.open(opts)
|
||||
other, err = infer_other(cur_buf)
|
||||
end
|
||||
if not other then
|
||||
util.error("%s", err or "no diff side")
|
||||
util.warning("%s", err or "no diff side")
|
||||
return
|
||||
end
|
||||
local mods = layout_mods(opts.mods, opts.layout)
|
||||
@@ -197,12 +197,12 @@ function M.open_pair(old, new, opts)
|
||||
local cur_buf = vim.api.nvim_get_current_buf()
|
||||
local new_buf, err = buf_for_side(new, cur_buf)
|
||||
if not new_buf then
|
||||
util.error("%s", err or "no new diff side")
|
||||
util.warning("%s", err or "no new diff side")
|
||||
return
|
||||
end
|
||||
local old_name, _, old_err = resolve_side(old, cur_buf)
|
||||
if not old_name then
|
||||
util.error("%s", old_err or "no old diff side")
|
||||
util.warning("%s", old_err or "no old diff side")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user