From ab2eade28da2acbbb5b58cd0379c7a138da77101 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Wed, 4 Jul 2018 09:55:05 +0300 Subject: [PATCH] rc: Synchronize important file writes Fixes #2178 --- rc/base/lint.kak | 2 +- rc/base/spell.kak | 2 +- rc/core/formatter.kak | 2 +- rc/extra/clang.kak | 2 +- rc/extra/jedi.kak | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rc/base/lint.kak b/rc/base/lint.kak index b38e3a8d..e02caa16 100644 --- a/rc/base/lint.kak +++ b/rc/base/lint.kak @@ -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* diff --git a/rc/base/spell.kak b/rc/base/spell.kak index 793b66f9..cd5a8277 100644 --- a/rc/base/spell.kak +++ b/rc/base/spell.kak @@ -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{ diff --git a/rc/core/formatter.kak b/rc/core/formatter.kak index d84318dd..1e4a7f86 100644 --- a/rc/core/formatter.kak +++ b/rc/core/formatter.kak @@ -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) diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index 6e825266..61a3708a 100644 --- a/rc/extra/clang.kak +++ b/rc/extra/clang.kak @@ -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. diff --git a/rc/extra/jedi.kak b/rc/extra/jedi.kak index 95eaa912..c48cb71c 100644 --- a/rc/extra/jedi.kak +++ b/rc/extra/jedi.kak @@ -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}