1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-23 15:23:29 +03:00

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

View File

@ -1,4 +1,5 @@
decl str grepcmd 'grep -RHn'
decl str toolsclient
def -shell-params -file-completion \
grep %{ %sh{
@ -10,13 +11,13 @@ def -shell-params -file-completion \
( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' >& ${output} ) >& /dev/null < /dev/null &
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*
setb filetype grep
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 %{

View File

@ -1,17 +1,18 @@
decl str makecmd make
decl str toolsclient
def -shell-params make %{ %sh{
output=$(mktemp -d -t kak-make.XXXXXXXX)/fifo
mkfifo ${output}
( ${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*
setb filetype make
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 %{