clang.kak: small cleanup

This commit is contained in:
Maxime Coste 2015-10-06 22:50:51 +01:00
parent 2c178f86cf
commit 6a236c563c

View File

@ -52,17 +52,17 @@ def -shell-params clang-parse -docstring "Parse the contents of the current buff
gsub(/:/, "\\:", id) gsub(/:/, "\\:", id)
desc=$4 ? $3 "\\n" $4 : $3 desc=$4 ? $3 "\\n" $4 : $3
gsub(/:/, "\\:", desc) gsub(/:/, "\\:", desc)
if (id in completions) if (id in docstrings)
completions[id]=completions[id] "\\n" desc docstrings[id]=docstrings[id] "\\n" desc
else else
completions[id]=desc docstrings[id]=desc
} }
END { END {
for (id in completions) for (id in docstrings)
{ {
menu=id menu=id
gsub(/(operator|new|delete)/, "{keyword}&{}", menu) gsub(/(operator|new|delete)/, "{keyword}&{}", menu)
print id "@" completions[id] "@" menu print id "@" docstrings[id] "@" menu
} }
}' | sort | paste -s -d ':' | sed -e "s/\\\\n/\\n/g; s/'/\\\\'/g") }' | sort | paste -s -d ':' | sed -e "s/\\\\n/\\n/g; s/'/\\\\'/g")
echo "eval -client ${kak_client} echo 'clang completion done' echo "eval -client ${kak_client} echo 'clang completion done'