From 27b6889dafc50202e0e931c5b36787b64f6b241d Mon Sep 17 00:00:00 2001 From: Andrey Orst Date: Thu, 16 May 2019 08:39:58 +0300 Subject: [PATCH] fix #2909 broken rust autocomplete --- rc/tools/rust/racer.kak | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rc/tools/rust/racer.kak b/rc/tools/rust/racer.kak index e3a61c29..3df0b418 100644 --- a/rc/tools/rust/racer.kak +++ b/rc/tools/rust/racer.kak @@ -19,7 +19,7 @@ define-command racer-complete -docstring "Complete the current selection with ra cursor="${kak_cursor_line} $((${kak_cursor_column} - 1))" racer_data=$(racer --interface tab-text complete-with-snippet ${cursor} ${kak_buffile} ${dir}/buf) compl=$(printf %s\\n "${racer_data}" | awk ' - BEGIN { FS = "\t"; ORS = ":" } + BEGIN { FS = "\t"; ORS = " " } /^PREFIX/ { column = ENVIRON["kak_cursor_column"] + $2 - $3 print ENVIRON["kak_cursor_line"] "." column "@@" ENVIRON["kak_timestamp"] @@ -75,12 +75,12 @@ define-command racer-complete -docstring "Complete the current selection with ra } candidate = word "|info -style menu %!" desc "!|" menu gsub(/:/, "\\:", candidate) - print candidate + gsub(/@/, "@@", candidate) + gsub(/~/, "~~", candidate) + print "%~" candidate "~" }' ) - printf %s\\n "evaluate-commands -client '${kak_client}' %{ - set-option buffer=${kak_bufname} racer_completions %@${compl%?}@ - }" | kak -p ${kak_session} + printf %s\\n "evaluate-commands -client '${kak_client}' %@ set-option 'buffer=${kak_bufname}' racer_completions ${compl%?} @" | kak -p ${kak_session} rm -r ${dir} ) > /dev/null 2>&1 < /dev/null & }