rc: Synchronize important file writes

Fixes #2178
This commit is contained in:
Frank LENORMAND 2018-07-04 09:55:05 +03:00
parent 5309b7b5e5
commit ab2eade28d
5 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ define-command lint -docstring 'Parse the current buffer with a linter' %{
%sh{
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-lint.XXXXXXXX)
mkfifo "$dir"/fifo
printf '%s\n' "evaluate-commands -no-hooks write $dir/buf"
printf '%s\n' "evaluate-commands -no-hooks write -sync $dir/buf"
printf '%s\n' "evaluate-commands -draft %{
edit! -fifo $dir/fifo -debug *lint-output*

View File

@ -12,7 +12,7 @@ Formats of language supported:
try %{ add-highlighter window ranges 'spell_regions' }
%sh{
file=$(mktemp -d "${TMPDIR:-/tmp}"/kak-spell.XXXXXXXX)/buffer
printf 'eval -no-hooks write %s\n' "${file}"
printf 'eval -no-hooks write -sync %s\n' "${file}"
printf 'set-option buffer spell_tmp_file %s\n' "${file}"
}
%sh{

View File

@ -6,7 +6,7 @@ define-command format -docstring "Format the contents of the current buffer" %{
if [ -n "${kak_opt_formatcmd}" ]; then
path_file_tmp=$(mktemp "${TMPDIR:-/tmp}"/kak-formatter-XXXXXX)
printf %s\\n "
write \"${path_file_tmp}\"
write -sync \"${path_file_tmp}\"
%sh{
readonly path_file_out=\$(mktemp \"${TMPDIR:-/tmp}\"/kak-formatter-XXXXXX)

View File

@ -14,7 +14,7 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-clang.XXXXXXXX)
mkfifo ${dir}/fifo
printf %s\\n "set-option buffer clang_tmp_dir ${dir}"
printf %s\\n "evaluate-commands -no-hooks write ${dir}/buf"
printf %s\\n "evaluate-commands -no-hooks write -sync ${dir}/buf"
}
# end the previous %sh{} so that its output gets interpreted by kakoune
# before launching the following as a background task.

View File

@ -8,7 +8,7 @@ define-command jedi-complete -docstring "Complete the current selection" %{
dir=$(mktemp -d "${TMPDIR:-/tmp}"/kak-jedi.XXXXXXXX)
mkfifo ${dir}/fifo
printf %s\\n "set-option buffer jedi_tmp_dir ${dir}"
printf %s\\n "evaluate-commands -no-hooks write ${dir}/buf"
printf %s\\n "evaluate-commands -no-hooks write -sync ${dir}/buf"
}
%sh{
dir=${kak_opt_jedi_tmp_dir}