go-tools.kak: fix set-options for go completions

Restores Go completions, as discussed in #2215
This commit is contained in:
Scott W. Dunlop 2018-09-04 10:58:57 -07:00
parent d73ec20285
commit 48f23f0312

View File

@ -35,14 +35,14 @@ define-command go-complete -docstring "Complete the current selection with gocod
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: -)
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}
) > /dev/null 2>&1 < /dev/null &
}
}
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 %{
execute-keys -draft <a-h><a-k>[\w\.].\z<ret>
go-complete