From 02e00153e0d3b0021bfc9d05d3b6b8811ac18401 Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Sat, 24 Nov 2018 21:58:45 +0300 Subject: [PATCH] call extra commands for every item --- rc/fzf.kak | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rc/fzf.kak b/rc/fzf.kak index 0da8aab..6b44e93 100644 --- a/rc/fzf.kak +++ b/rc/fzf.kak @@ -165,15 +165,18 @@ fzf -params 2..4 %{ evaluate-commands %sh{ ctrl-v) wincmd="tmux-new-horizontal" ;; *) - [ -n "$action" ] && printf "%s\n" "evaluate-commands -client $kak_client '$command' '$action'" | kak -p $kak_session ;; + if [ -n "$action" ]; then + printf "%s\n" "evaluate-commands -client $kak_client '$command' '$action'" | kak -p $kak_session + [ -n "$extra_action" ] && printf "%s\n" "evaluate-commands -client $kak_client $extra_action" | kak -p $kak_session + fi ;; esac kakoune_command() { printf "%s\n" "evaluate-commands -client $kak_client $wincmd $command %{$1}" + [ -n "$extra_action" ] && printf "%s\n" "evaluate-commands -client $kak_client $extra_action" } while read item; do kakoune_command "$item" | kak -p $kak_session done - [ -n "$extra_action" ] && printf "%s\n" "evaluate-commands -client $kak_client $extra_action" | kak -p $kak_session ) < $tmp fi rm $tmp