Use fifo buffers for git-tools command output
This commit is contained in:
parent
71f5b61942
commit
54ceb3a0d0
|
@ -32,20 +32,15 @@ def -shell-params \
|
||||||
log) filetype=git-log ;;
|
log) filetype=git-log ;;
|
||||||
status) filetype=git-status ;;
|
status) filetype=git-status ;;
|
||||||
esac
|
esac
|
||||||
tmpfile=$(mktemp /tmp/kak-git-XXXXXX)
|
output=$(mktemp -d -t kak-git.XXXXXXXX)/fifo
|
||||||
if git "$@" > ${tmpfile}; then
|
mkfifo ${output}
|
||||||
[ -n "$kak_opt_docsclient" ] && echo "eval -client '$kak_opt_docsclient' %{"
|
( git "$@" > ${output} 2>&1 ) > /dev/null 2>&1 < /dev/null &
|
||||||
|
|
||||||
echo "edit! -scratch *git*
|
echo "eval -try-client '$kak_opt_docsclient' %{
|
||||||
exec |cat<space>${tmpfile}<ret>gk
|
edit! -fifo ${output} *git*
|
||||||
nop %sh{rm ${tmpfile}}
|
set buffer filetype '${filetype}'
|
||||||
set buffer filetype '${filetype}'"
|
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }
|
||||||
|
}"
|
||||||
[ -n "$kak_opt_docsclient" ] && echo "}"
|
|
||||||
else
|
|
||||||
echo "echo %{git $@ failed, see *debug* buffer}"
|
|
||||||
rm ${tmpfile}
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run_git_blame() {
|
run_git_blame() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user