toolsclient option support is back, add docsclient for git-diff

This commit is contained in:
Maxime Coste 2013-04-17 19:15:15 +02:00
parent 021756dfd4
commit 8d83a5ff9e
3 changed files with 15 additions and 8 deletions

View File

@ -1,4 +1,5 @@
decl line-flag-list git_diff_flags decl line-flag-list git_diff_flags
decl str docsclient
def git-diff-update-buffer %{ %sh{ def git-diff-update-buffer %{ %sh{
added_lines="" added_lines=""
@ -59,10 +60,14 @@ def git-blame %{
def -shell-params git-show %{ %sh{ def -shell-params git-show %{ %sh{
tmpfile=$(mktemp /tmp/kak-git-show-XXXXXX) tmpfile=$(mktemp /tmp/kak-git-show-XXXXXX)
if git show "$@" > ${tmpfile}; then if git show "$@" > ${tmpfile}; then
[[ -n "$kak_opt_docsclient" ]] && echo "eval -client '$kak_opt_docsclient' %{"
echo "edit! -scratch *git-show* echo "edit! -scratch *git-show*
exec |cat<space>${tmpfile}<ret>gk exec |cat<space>${tmpfile}<ret>gk
nop %sh{rm ${tmpfile}} nop %sh{rm ${tmpfile}}
setb filetype diff" setb filetype diff"
[[ -n "$kak_opt_docsclient" ]] && echo "}"
else else
echo "echo %{git show '$@' failed, see *debug* buffer}" echo "echo %{git show '$@' failed, see *debug* buffer}"
rm ${tmpfile} rm ${tmpfile}

View File

@ -1,4 +1,5 @@
decl str grepcmd 'grep -RHn' decl str grepcmd 'grep -RHn'
decl str toolsclient
def -shell-params -file-completion \ def -shell-params -file-completion \
grep %{ %sh{ grep %{ %sh{
@ -10,13 +11,13 @@ def -shell-params -file-completion \
( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null & ( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null &
fi fi
if [[ -n "$kak_opt_toolsclient" ]]; then echo "eval -client '$kak_opt_toolsclient' %{"; fi [[ -n "$kak_opt_toolsclient" ]] && echo "eval -client '$kak_opt_toolsclient' %{"
echo "edit! -fifo ${output} *grep* echo "edit! -fifo ${output} *grep*
setb filetype grep setb filetype grep
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }" hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }"
if [[ -n "$kak_opt_toolsclient" ]]; then echo "}"; fi [[ -n "$kak_opt_toolsclient" ]] && echo "}"
}} }}
hook global WinSetOption filetype=grep %{ hook global WinSetOption filetype=grep %{

View File

@ -1,17 +1,18 @@
decl str makecmd make decl str makecmd make
decl str toolsclient
def -shell-params make %{ %sh{ def -shell-params make %{ %sh{
output=$(mktemp -d -t kak-make.XXXXXXXX)/fifo output=$(mktemp -d -t kak-make.XXXXXXXX)/fifo
mkfifo ${output} mkfifo ${output}
( ${kak_opt_makecmd} $@ >& ${output} ) >& /dev/null < /dev/null & ( ${kak_opt_makecmd} $@ >& ${output} ) >& /dev/null < /dev/null &
if [[ -n "$kak_opt_toolsclient" ]]; then echo "eval -client '$kak_opt_toolsclient' %{"; fi [[ -n "$kak_opt_toolsclient" ]] && echo "eval -client '$kak_opt_toolsclient' %{"
echo "edit! -fifo ${output} *make* echo "edit! -fifo ${output} *make*
setb filetype make setb filetype make
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }" hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }"
if [[ -n "$kak_opt_toolsclient" ]]; then echo "}"; fi [[ -n "$kak_opt_toolsclient" ]] && echo "}"
}} }}
hook global WinSetOption filetype=make %{ hook global WinSetOption filetype=make %{