From 48f23f0312c7dd1bcb70db55406b95e091a37dd7 Mon Sep 17 00:00:00 2001 From: "Scott W. Dunlop" Date: Tue, 4 Sep 2018 10:58:57 -0700 Subject: [PATCH 1/3] go-tools.kak: fix set-options for go completions Restores Go completions, as discussed in #2215 --- rc/extra/go-tools.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/extra/go-tools.kak b/rc/extra/go-tools.kak index 9ea17562..4e4d2d96 100644 --- a/rc/extra/go-tools.kak +++ b/rc/extra/go-tools.kak @@ -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 [\w\.].\z go-complete From 575b02b1711f73b53de23e7ddb52782a4e145649 Mon Sep 17 00:00:00 2001 From: "Scott W. Dunlop" Date: Tue, 4 Sep 2018 11:41:35 -0700 Subject: [PATCH 3/3] go-tools.kak: quote completions and scope Since the gocode completions contain white space, they cannot be used without quotations. Also, since I'm in there, the buffer should be quoted for heathens who use white space in their paths. --- rc/extra/go-tools.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/extra/go-tools.kak b/rc/extra/go-tools.kak index 4e4d2d96..cdeec130 100644 --- a/rc/extra/go-tools.kak +++ b/rc/extra/go-tools.kak @@ -33,9 +33,9 @@ define-command go-complete -docstring "Complete the current selection with gocod column_offset=$(echo "${gocode_data}" | head -n1 | cut -d, -f1) 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}' %{ - 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 & }