From 656b8c1c9578684ebb91cc05c50ae3c03f40d50f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 11 May 2016 23:57:21 +0100 Subject: [PATCH] Fix clang-show-completion-info command --- rc/extra/clang.kak | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index f4c51f141..6aeeecd90 100644 --- a/rc/extra/clang.kak +++ b/rc/extra/clang.kak @@ -100,9 +100,9 @@ def clang-complete -docstring "Complete the current selection with clang" %{ cla def -hidden clang-show-completion-info %[ try %[ eval -draft %[ - exec '{(^\(b' + exec {( ^\( b \`\w+\' %sh[ - desc=$(printf %s\\n "${kak_opt_clang_completions}" | sed -ne "{ s/\([^\\]\):/\1\n/g }; /^${kak_selection}@/ { s/^[^@]\+@//; s/@.*$//; s/\\\:/:/g; P }; D") + desc=$(printf %s\\n "${kak_opt_clang_completions}" | sed -ne "{ s/\([^\\]\):/\1\n/g }; /^${kak_selection}|/ { s/^[^|]\+|//; s/|.*$//; s/\\\:/:/g; P }; D") if [ -n "$desc" ]; then printf %s\\n "eval -client $kak_client %{info -anchor ${kak_cursor_line}.${kak_cursor_column} -placement above %{${desc}}}" fi @@ -138,6 +138,7 @@ def -hidden clang-show-error-info %{ %sh{ def clang-enable-diagnostics -docstring "Activate automatic diagnostics of the code by clang" %{ addhl flag_lines default clang_flags hook window -group clang-diagnostics NormalIdle .* %{ clang-show-error-info } + hook window -group clang-diagnostics WinSetOption ^clang_errors=.* %{ info; clang-show-error-info } } def clang-disable-diagnostics -docstring "Disable automatic diagnostics of the code" %{