fix clang auto completion at eol

This commit is contained in:
Maxime Coste 2014-01-25 18:49:44 +00:00
parent a32cac2f66
commit 00c1523c6e

View File

@ -16,7 +16,7 @@ def clang-complete %{
( (
pos=-:${kak_cursor_line}:${kak_cursor_column} pos=-:${kak_cursor_line}:${kak_cursor_column}
cd $(dirname ${kak_bufname}) cd $(dirname ${kak_bufname})
output=$(clang++ -x c++ -fsyntax-only ${kak_opt_clang_options} -Xclang -code-completion-at=${pos} - < ${kak_opt_clang_filename} | output=$(clang++ -x c++ -fsyntax-only ${kak_opt_clang_options} -Xclang -code-completion-at=${pos} - < ${kak_opt_clang_filename} |& tee /tmp/kak-clang-out |
grep -E "^COMPLETION:[^:]+:" | perl -pe 's/^COMPLETION:[^:]+: +//; s/:/\\:/g; s/\[#.*?#\]|<#.*?#>(, *|\))?|\{#.*?#\}\)?//g') grep -E "^COMPLETION:[^:]+:" | perl -pe 's/^COMPLETION:[^:]+: +//; s/:/\\:/g; s/\[#.*?#\]|<#.*?#>(, *|\))?|\{#.*?#\}\)?//g')
rm -r $(dirname ${kak_opt_clang_filename}) rm -r $(dirname ${kak_opt_clang_filename})
completions="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}" completions="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}"
@ -30,7 +30,7 @@ def clang-complete %{
def clang-enable-autocomplete %{ def clang-enable-autocomplete %{
hook window -id clang-autocomplete InsertIdle .* %{ try %{ hook window -id clang-autocomplete InsertIdle .* %{ try %{
exec -draft <space><a-h><a-k>(\.|->|::).$<ret> exec -draft <a-h><a-k>(\.|->|::).$<ret>
echo 'completing...' echo 'completing...'
clang-complete clang-complete
} } } }