diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index 0043cb51e..1e0a849af 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 } }