Use -once hooks to remove fifo directories

This commit is contained in:
Maxime Coste 2018-08-19 08:04:31 +10:00
parent 2e138c835a
commit 1485150b68
5 changed files with 5 additions and 20 deletions

View File

@ -28,10 +28,7 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
edit! -fifo $dir/fifo -debug *lint-output* edit! -fifo $dir/fifo -debug *lint-output*
set-option buffer filetype make set-option buffer filetype make
set-option buffer make_current_error_line 0 set-option buffer make_current_error_line 0
hook -always -group fifo buffer BufCloseFifo .* %{ hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r '$dir' } }
nop %sh{ rm -r '$dir' }
remove-hooks buffer fifo
}
}" }"
{ # do the parsing in the background and when ready send to the session { # do the parsing in the background and when ready send to the session

View File

@ -20,10 +20,7 @@ All the optional arguments are forwarded to the grep utility} \
edit! -fifo ${output} -scroll *grep* edit! -fifo ${output} -scroll *grep*
set-option buffer filetype grep set-option buffer filetype grep
set-option buffer grep_current_line 0 set-option buffer grep_current_line 0
hook -always -group fifo buffer BufCloseFifo .* %{ hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } }
nop %sh{ rm -r $(dirname ${output}) }
remove-hooks buffer fifo
}
}" }"
}} }}

View File

@ -19,10 +19,7 @@ All the optional arguments are forwarded to the make utility} \
edit! -fifo ${output} -scroll *make* edit! -fifo ${output} -scroll *make*
set-option buffer filetype make set-option buffer filetype make
set-option buffer make_current_error_line 0 set-option buffer make_current_error_line 0
hook -always -group fifo buffer BufCloseFifo .* %{ hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } }
nop %sh{ rm -r $(dirname ${output}) }
remove-hooks buffer fifo
}
}" }"
}} }}

View File

@ -24,10 +24,7 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are
edit! -fifo ${dir}/fifo -debug *clang-output* edit! -fifo ${dir}/fifo -debug *clang-output*
set-option buffer filetype make set-option buffer filetype make
set-option buffer make_current_error_line 0 set-option buffer make_current_error_line 0
hook -always -group fifo buffer BufCloseFifo .* %{ hook -once -always buffer BufCloseFifo .* %{ nop %sh{ rm -r ${dir} } }
nop %sh{ rm -r ${dir} }
remove-hooks buffer fifo
}
}" }"
# this runs in a detached shell, asynchronously, so that kakoune does # this runs in a detached shell, asynchronously, so that kakoune does
# not hang while clang is running. As completions references a cursor # not hang while clang is running. As completions references a cursor

View File

@ -53,10 +53,7 @@ Available commands:\n add\n rm\n blame\n commit\n checkout\n diff\n hide-
printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{ printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{
edit! -fifo ${output} *git* edit! -fifo ${output} *git*
set-option buffer filetype '${filetype}' set-option buffer filetype '${filetype}'
hook -always -group fifo buffer BufCloseFifo .* %{ hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } }
nop %sh{ rm -r $(dirname ${output}) }
remove-hooks buffer fifo
}
}" }"
} }