Merge remote-tracking branch 'swdunlop/master'

This commit is contained in:
Maxime Coste 2018-09-10 21:18:07 +10:00
commit 73b6f0994f

View File

@ -33,16 +33,16 @@ define-command go-complete -docstring "Complete the current selection with gocod
column_offset=$(echo "${gocode_data}" | head -n1 | cut -d, -f1) column_offset=$(echo "${gocode_data}" | head -n1 | cut -d, -f1)
header="${kak_cursor_line}.$((${kak_cursor_column} - $column_offset))@${kak_timestamp}" header="${kak_cursor_line}.$((${kak_cursor_column} - $column_offset))@${kak_timestamp}"
compl=$(echo "${gocode_data}" | sed 1d | awk -F ",," '{print $2 "||" $1}' | paste -s -d: -) compl=$(echo "${gocode_data}" | sed 1d | awk -F ",," '{print "%~" $2 "||" $1 "~"}' | paste -s -)
printf %s\\n "evaluate-commands -client '${kak_client}' %{ printf %s\\n "evaluate-commands -client '${kak_client}' %{
set-option buffer=${kak_bufname} gocode_completions '${header}:${compl}' set-option 'buffer=${kak_bufname}' gocode_completions ${header} ${compl}
}" | kak -p ${kak_session} }" | kak -p ${kak_session}
) > /dev/null 2>&1 < /dev/null & ) > /dev/null 2>&1 < /dev/null &
} }
} }
define-command go-enable-autocomplete -docstring "Add gocode completion candidates to the completer" %{ define-command go-enable-autocomplete -docstring "Add gocode completion candidates to the completer" %{
set-option window completers "option=gocode_completions:%opt{completers}" set-option window completers "option=gocode_completions" %opt{completers}
hook window -group go-autocomplete InsertIdle .* %{ try %{ hook window -group go-autocomplete InsertIdle .* %{ try %{
execute-keys -draft <a-h><a-k>[\w\.].\z<ret> execute-keys -draft <a-h><a-k>[\w\.].\z<ret>
go-complete go-complete