Fix tabs in clang.kak and improve escaping

This commit is contained in:
Maxime Coste 2015-01-30 13:42:13 +00:00
parent 47c8a4378f
commit b4661e37d2

View File

@ -46,8 +46,10 @@ def -shell-params clang-parse %{
gsub(/ +$/, "", $3) gsub(/ +$/, "", $3)
id=substr($2, 1, length($2)-1) id=substr($2, 1, length($2)-1)
gsub(/:/, "\\:", id) gsub(/:/, "\\:", id)
gsub(/"/, "\\\"", id)
desc=$4 ? $3 "\\n" $4 : $3 desc=$4 ? $3 "\\n" $4 : $3
gsub(/:/, "\\:", desc) gsub(/:/, "\\:", desc)
gsub(/"/, "\\\"", desc)
if (id in completions) if (id in completions)
completions[id]=completions[id] "\\n" desc completions[id]=completions[id] "\\n" desc
else else
@ -58,7 +60,7 @@ def -shell-params clang-parse %{
print id "@" completions[id] print id "@" completions[id]
}' | sort | paste -s -d ':' | sed -e 's/\\n/\n/g') }' | sort | paste -s -d ':' | sed -e 's/\\n/\n/g')
echo "eval -client ${kak_client} echo completed echo "eval -client ${kak_client} echo completed
set 'buffer=${kak_buffile}' clang_completions %[${header}:${compl}]" | kak -p ${kak_session} set 'buffer=${kak_buffile}' clang_completions \"${header}:${compl}\"" | kak -p ${kak_session}
else else
clang++ -x ${ft} -fsyntax-only ${kak_opt_clang_options} - < ${dir}/buf 2> ${dir}/stderr clang++ -x ${ft} -fsyntax-only ${kak_opt_clang_options} - < ${dir}/buf 2> ${dir}/stderr
fi fi