1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-09-19 16:57:22 +03:00

jedi.kak: remove the tmp dir directly in the %sh block

This commit is contained in:
Maxime Coste 2014-11-19 13:54:36 +00:00
parent 4757cc4af6
commit d7a31f8983

View File

@ -10,13 +10,7 @@ def jedi-complete %{
}
%sh{
dir=${kak_opt_jedi_tmp_dir}
echo "eval -draft %{
edit! -fifo ${dir}/fifo *jedi-output*
hook -group jedi-cleanup buffer BufCloseFifo .* %{
nop %sh{ rm -r ${dir} }
rmhooks buffer jedi-cleanup
}
}"
echo "eval -draft %{ edit! -fifo ${dir}/fifo *jedi-output* }"
(
cd $(dirname ${kak_buffile})
header="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}"
@ -27,8 +21,8 @@ def jedi-complete %{
print ':'.join([str(c.name) + "@" + str(c.description).replace(":", "\\:") for c in script.completions()])
END
)
echo "eval -client ${kak_client} %[ echo completed; set 'buffer=${kak_buffile}' jedi_completions %[${header}:${compl}] ]" | kak -p ${kak_session}
rm -r ${dir}
) > /dev/null 2>&1 < /dev/null &
}
}