From e3242735677191a9e58ed5e4c7feeb6913366cc2 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 7 Jul 2023 11:53:16 +0200 Subject: [PATCH] zsh:diffcmds(): Add pipes TODO and format --- .config/zsh/zshrc.d/40-functions.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index e2fb70f..bd8622e 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -672,6 +672,7 @@ diffcmds() { # Just execute the command without *diff if there is only one argument if (( i + 1 == # )); then + # TODO: Implement better way to make pipes possible eval "${(@)${(q@)${@:1:$((i-1))}//\%\%/${@[$#]}}/#%\\|/|}" return fi @@ -695,7 +696,12 @@ diffcmds() { # of quotation but unquoting single pipes again. cmdline=("$cmd") for arg in "${@:$((i+1))}"; do - cmdline+=("$ps_sub" "${(@)${(q@)${@:1:$((i-1))}//\%\%/$arg}/#%\\|/|}" ")") + # TODO: Implement better way to make pipes possible + cmdline+=( + "$ps_sub" + "${(@)${(q@)${@:1:$((i-1))}//\%\%/$arg}/#%\\|/|}" + ")" + ) done eval "$cmdline[@]" }