From 84d72eb4ba6e839e4fe78042a31aa9a3c33b65b7 Mon Sep 17 00:00:00 2001 From: Loric Brevet Date: Fri, 18 Nov 2022 12:29:02 +0100 Subject: [PATCH] Make ctags.kak compatible with original awk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Positional arguments in awk’s printf is a feature that is only available in the GNU implementation of awk (gawk). So the ctags auto-completion feature was broken in Kakoune if the installed version of awk was nawk or mawk. This simple change makes it retro-compatible with those versions. See https://www.gnu.org/software/gawk/manual/html_node/Printf-Ordering.html --- rc/tools/ctags.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/tools/ctags.kak b/rc/tools/ctags.kak index 1d6b26c5..7653562a 100644 --- a/rc/tools/ctags.kak +++ b/rc/tools/ctags.kak @@ -72,7 +72,7 @@ define-command ctags-complete -docstring "Complete the current selection" %{ eval "set -- $kak_quoted_opt_ctagsfiles" for ctagsfile in "$@"; do ${kak_opt_readtagscmd} -p -t "$ctagsfile" ${kak_selection} - done | awk '{ uniq[$1]++ } END { for (elem in uniq) printf " %1$s||%1$s", elem }' + done | awk '{ uniq[$1]++ } END { for (elem in uniq) printf " %s||%s", elem, elem }' ) printf %s\\n "evaluate-commands -client ${kak_client} set-option buffer=${kak_bufname} ctags_completions ${header}${compl}" | \ kak -p ${kak_session}