zsh:diffcmds: Make diff_cmd overwritable by caller
This commit is contained in:
@@ -673,10 +673,13 @@ diffcmds() {
|
|||||||
# TODO: Support own arguments for example to switch the placeholder or the
|
# TODO: Support own arguments for example to switch the placeholder or the
|
||||||
# diffcmd
|
# diffcmd
|
||||||
# TODO: Find better way to dequote pipes. (e.g. `%|` to use a pipe?)
|
# TODO: Find better way to dequote pipes. (e.g. `%|` to use a pipe?)
|
||||||
local diff_cmd i arg ps_sub
|
local i arg ps_sub
|
||||||
local -a template args final_cmd
|
local -a template args final_cmd
|
||||||
|
|
||||||
if (( $+commands[vimdiff] && ! $+commands[diff] )); then
|
local diff_cmd="$diff_cmd"
|
||||||
|
if [[ -n $diff_cmd ]]; then
|
||||||
|
# already set by caller
|
||||||
|
elif (( $+commands[vimdiff] && ! $+commands[diff] )); then
|
||||||
diff_cmd=vimdiff
|
diff_cmd=vimdiff
|
||||||
elif (( $+commands[diff] && ! $+commands[vimdiff] )); then
|
elif (( $+commands[diff] && ! $+commands[vimdiff] )); then
|
||||||
diff_cmd=diff
|
diff_cmd=diff
|
||||||
|
|||||||
Reference in New Issue
Block a user