summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-02-21 13:38:12 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-02-21 13:38:12 +0100
commitefc0a8bc07e0c61b933aa37ea2a02591348aed24 (patch)
treea463cf66b73b588d3a6f7053875f76fc0e85fdd9 /src
parent901d5ea1be8c97cc461554253b63ea13a08fcdee (diff)
grep,make: support specifying client with toolsclient option
When toolsclient option is set, make and grep opens their buffer in the specified client instead of the current one.
Diffstat (limited to 'src')
-rw-r--r--src/rc/grep.kak5
-rw-r--r--src/rc/make.kak5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/rc/grep.kak b/src/rc/grep.kak
index 997f1ff0..0bd72d52 100644
--- a/src/rc/grep.kak
+++ b/src/rc/grep.kak
@@ -9,10 +9,15 @@ def -shell-params -file-completion \
else
( ${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
+
echo "try %{ db *grep* } catch %{}
edit -fifo ${output} *grep*
setb filetype grep
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }"
+
+ if [[ -n "$kak_opt_toolsclient" ]]; then echo "}"; fi
}}
hook global WinSetOption filetype=grep %{
diff --git a/src/rc/make.kak b/src/rc/make.kak
index 2c3d4aa5..73a4a293 100644
--- a/src/rc/make.kak
+++ b/src/rc/make.kak
@@ -4,10 +4,15 @@ 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
+
echo "try %{ db *make* } catch %{}
edit -fifo ${output} *make*
setb filetype make
hook buffer BufClose .* %{ nop %sh{ rm -r $(dirname ${output}) } }"
+
+ if [[ -n "$kak_opt_toolsclient" ]]; then echo "}"; fi
}}
hook global WinSetOption filetype=make %{