1
0
Fork 0

further simplifications of main script

This commit is contained in:
Andrey Orst 2019-03-27 09:27:51 +03:00
parent 29782b25b8
commit b8bcbc33c7

View file

@ -157,28 +157,28 @@ fzf -shell-script-completion %{echo "-kak-cmd\n-items-cmd\n-fzf-args\n-post-acti
cmd="terminal %{${fzfcmd}}" cmd="terminal %{${fzfcmd}}"
fi fi
( printf "%s\n" "${cmd}"
printf "%s\n" "${cmd}" | kak -p ${kak_session}
while [ -e ${fzfcmd} ]; do ( while [ -e ${fzfcmd} ]; do
sleep 0.1 sleep 0.1
done done
if [ -s ${result} ]; then if [ -s ${result} ]; then
( (
read action while read line; do
case ${action} in case ${line} in
ctrl-w) wincmd="fzf-window" ;; ctrl-w) wincmd="fzf-window" ;;
ctrl-s) wincmd="fzf-vertical" ;; ctrl-s) wincmd="fzf-vertical" ;;
ctrl-v) wincmd="fzf-horizontal" ;; ctrl-v) wincmd="fzf-horizontal" ;;
*) if [ -n "${action}" ]; then *) item=${line} ;;
printf "%s\n" "evaluate-commands -client ${kak_client} '${kakoune_cmd}' '${action}'" | kak -p ${kak_session} esac
[ -n "${post_action}" ] && printf "%s\n" "evaluate-commands -client ${kak_client} ${post_action}" | kak -p ${kak_session} if [ -n "${item}" ]; then
fi ;; printf "%s\n" "evaluate-commands -client ${kak_client} ${wincmd} %{${kakoune_cmd} %{${item}}}"
esac fi
while read item; do
printf "%s\n" "evaluate-commands -client ${kak_client} ${wincmd} %{${kakoune_cmd} %{${item}}}" | kak -p ${kak_session}
[ -n "${post_action}" ] && printf "%s\n" "evaluate-commands -client ${kak_client} ${post_action}" | kak -p ${kak_session}
done done
) < ${result} if [ -n "${post_action}" ]; then
printf "%s\n" "evaluate-commands -client ${kak_client} %{${post_action}}"
fi
) < ${result} | kak -p ${kak_session}
fi fi
rm -rf ${fzf_tmp} rm -rf ${fzf_tmp}
) > /dev/null 2>&1 < /dev/null & ) > /dev/null 2>&1 < /dev/null &