1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 03:56:32 +03:00

Fix clang-show-completion-info command

This commit is contained in:
Maxime Coste 2016-05-11 23:57:21 +01:00
parent 84f62e6ff2
commit 656b8c1c95

View File

@ -100,9 +100,9 @@ def clang-complete -docstring "Complete the current selection with clang" %{ cla
def -hidden clang-show-completion-info %[ try %[ def -hidden clang-show-completion-info %[ try %[
eval -draft %[ eval -draft %[
exec '<space>{(<a-k>^\(<ret>b' exec <space>{( <a-k> ^\( <ret> b <a-k> \`\w+\' <ret>
%sh[ %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 if [ -n "$desc" ]; then
printf %s\\n "eval -client $kak_client %{info -anchor ${kak_cursor_line}.${kak_cursor_column} -placement above %{${desc}}}" printf %s\\n "eval -client $kak_client %{info -anchor ${kak_cursor_line}.${kak_cursor_column} -placement above %{${desc}}}"
fi 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" %{ def clang-enable-diagnostics -docstring "Activate automatic diagnostics of the code by clang" %{
addhl flag_lines default clang_flags addhl flag_lines default clang_flags
hook window -group clang-diagnostics NormalIdle .* %{ clang-show-error-info } 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" %{ def clang-disable-diagnostics -docstring "Disable automatic diagnostics of the code" %{