clang.kak: Try to detect word boundaries and highlight types/operators

This commit is contained in:
Maxime Coste 2015-10-06 23:22:36 +01:00
parent 6a236c563c
commit bb16be6cf2

View File

@ -61,7 +61,9 @@ def -shell-params clang-parse -docstring "Parse the contents of the current buff
for (id in docstrings) for (id in docstrings)
{ {
menu=id menu=id
gsub(/(operator|new|delete)/, "{keyword}&{}", menu) gsub(/(^|[^[:alnum:]_])(operator|new|delete)($|[^[:alnum:]_])/, "{keyword}&{}", menu)
gsub(/(^|[[:space:]])(int|size_t|bool|char|unsigned|signed|long)($|[[:space:]])/, "{type}&{}", menu)
gsub(/[^[:alnum:]{}_]+/, "{operator}&{}", menu)
print id "@" docstrings[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")