From 24372938c5a9f700079df58509daa0dc0b06a361 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 31 Mar 2016 13:57:12 +0100 Subject: [PATCH] Improve parse error display in clang.kak --- rc/extra/clang.kak | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index 0043cb51..1e0a849a 100644 --- a/rc/extra/clang.kak +++ b/rc/extra/clang.kak @@ -97,7 +97,6 @@ def -hidden clang-show-completion-info %[ try %[ eval -draft %[ exec '{(^\(b' %sh[ - # desc=$(echo "${kak_opt_clang_completions}" | sed -e 's/\([^\\]\):/\1\n/g;' | sed -ne "/^${kak_selection}@/ { s/^[^@]\+@//; s/@.*$//; s/\\:/:/g; p }") desc=$(echo "${kak_opt_clang_completions}" | sed -ne "{ s/\([^\\]\):/\1\n/g }; /^${kak_selection}@/ { s/^[^@]\+@//; s/@.*$//; s/\\\:/:/g; P }; D") if [ -n "$desc" ]; then echo "eval -client $kak_client %{info -anchor ${kak_cursor_line}.${kak_cursor_column} -placement above %{${desc}}}" @@ -125,8 +124,8 @@ def clang-disable-autocomplete -docstring "Disable automatic clang completion" % } def -hidden clang-show-error-info %{ %sh{ - printf %s "${kak_opt_clang_errors}" | grep "^${kak_cursor_line},.*" | if read line; then - desc=$(printf %s "${line}" | sed -e "s/^[[:digit:]]\+,//g; s/'/\\\\'/g") + desc=$(printf %s "${kak_opt_clang_errors}" | sed -ne "/^${kak_cursor_line},.*/ { s/^[[:digit:]]\+,//g; s/'/\\\\'/g; p }") + if [ -n "$desc" ]; then echo "info -anchor ${kak_cursor_line}.${kak_cursor_column} '${desc}'" fi } }