Slight code cleanup in grep.kak
This commit is contained in:
parent
a17a0345cf
commit
f2159750d2
|
@ -8,13 +8,13 @@ define-command -params .. -file-completion \
|
||||||
-docstring %{grep [<arguments>]: grep utility wrapper
|
-docstring %{grep [<arguments>]: grep utility wrapper
|
||||||
All the optional arguments are forwarded to the grep utility} \
|
All the optional arguments are forwarded to the grep utility} \
|
||||||
grep %{ evaluate-commands %sh{
|
grep %{ evaluate-commands %sh{
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
set -- "${kak_selection}"
|
||||||
|
fi
|
||||||
|
|
||||||
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-grep.XXXXXXXX)/fifo
|
output=$(mktemp -d "${TMPDIR:-/tmp}"/kak-grep.XXXXXXXX)/fifo
|
||||||
mkfifo ${output}
|
mkfifo ${output}
|
||||||
if [ $# -gt 0 ]; then
|
( ${kak_opt_grepcmd} "$@" | tr -d '\r' > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
||||||
( ${kak_opt_grepcmd} "$@" | tr -d '\r' > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
|
||||||
else
|
|
||||||
( ${kak_opt_grepcmd} "${kak_selection}" | tr -d '\r' > ${output} 2>&1 & ) > /dev/null 2>&1 < /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{
|
printf %s\\n "evaluate-commands -try-client '$kak_opt_toolsclient' %{
|
||||||
edit! -fifo ${output} *grep*
|
edit! -fifo ${output} *grep*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user