Merge remote-tracking branch 'lenormf/fix-3681'

This commit is contained in:
Maxime Coste 2020-12-05 10:53:08 +11:00
commit fd95e91770

View File

@ -14,6 +14,14 @@ declare-option -hidden int lint_warning_count
declare-option -docstring "name of the client in which utilities display information" \ declare-option -docstring "name of the client in which utilities display information" \
str toolsclient str toolsclient
define-command -hidden -params 1 lint-open-output-buffer %{
evaluate-commands -try-client %opt{toolsclient} %{
edit! -fifo "%arg{1}/fifo" -debug *lint-output*
set-option buffer filetype make
set-option buffer make_current_error_line 0
}
}
define-command \ define-command \
-hidden \ -hidden \
-params 1 \ -params 1 \
@ -42,14 +50,6 @@ define-command \
# A directory to keep all our temporary data. # A directory to keep all our temporary data.
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-lint.XXXXXXXX) dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-lint.XXXXXXXX)
# A fifo to send the results back to a Kakoune buffer.
mkfifo "$dir"/fifo
printf '%s\n' "evaluate-commands -try-client '$kak_opt_toolsclient' %{
edit! -fifo $(kakquote "$dir/fifo") -debug *lint-output*
set-option buffer filetype make
set-option buffer make_current_error_line 0
}"
# Write all the selection descriptions to files. # Write all the selection descriptions to files.
eval set -- "$kak_selections_desc" eval set -- "$kak_selections_desc"
i=0 i=0
@ -207,6 +207,10 @@ define-command \
"$kak_client" "$kak_client"
fi | kak -p "$kak_session" fi | kak -p "$kak_session"
# A fifo to send the results back to a Kakoune buffer.
mkfifo "$dir"/fifo
printf 'lint-open-output-buffer %s' "$(kakquote "$dir")" | kak -p "$kak_session"
# We are done here. Send the results to Kakoune, # We are done here. Send the results to Kakoune,
# and clean up. # and clean up.
cat "$dir"/result > "$dir"/fifo cat "$dir"/result > "$dir"/fifo