diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index 224080e1..7b42d580 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -25,7 +25,7 @@ evaluate-commands %sh{ for lang in ${languages}; do printf 'add-highlighter shared/markdown/%s region ```\h*%s\\b ``` regions\n' "${lang}" "${lang}" printf 'add-highlighter shared/markdown/%s/ default-region fill meta\n' "${lang}" - ref=$([ "${lang}" = kak ] && echo kakrc || echo "${lang}") + [ "${lang}" = kak ] && ref=kakrc || ref="${lang}" printf 'add-highlighter shared/markdown/%s/inner region \A```[^\\n]*\K (?=```) ref %s\n' "${lang}" "${ref}" done } diff --git a/rc/base/restructuredtext.kak b/rc/base/restructuredtext.kak index 6c994a44..4c072c7f 100644 --- a/rc/base/restructuredtext.kak +++ b/rc/base/restructuredtext.kak @@ -18,7 +18,7 @@ evaluate-commands %sh{ julia kak kickstart latex lisp lua makefile moon objc \ perl pug python ragel ruby rust sass scala scss sh swift \ tupfile yaml; do - ref=$(if [ "$ft" = kak ]; then echo "kakrc"; else echo "$ft"; fi) + if [ "$ft" = kak ]; then ref="kakrc"; else ref="$ft"; fi printf 'add-highlighter shared/restructuredtext/%s region %s %s ref %s\n' "$ft" '\.\.\h*'$ft'::\h*c\h*\n' '^\S' "$ref" done } diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 9c89ae0e..def12daa 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -162,7 +162,7 @@ evaluate-commands %sh{ types="char double float int long short signed size_t unsigned void" values="NULL" - join() { printf "%s" "$1" | tr -s ' \n' "$2"; } + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } # Add the language's grammar to the static completion list printf '%s\n' "hook global WinSetOption filetype=c %{ @@ -212,7 +212,7 @@ evaluate-commands %sh{ nullptr_t ptrdiff_t short signed size_t unsigned void wchar_t" values="NULL false nullptr this true" - join() { printf "%s" "$1" | tr -s ' \n' "$2"; } + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=cpp %{ @@ -254,7 +254,7 @@ evaluate-commands %sh{ decorators="autoreleasepool catch class end implementation interface property protocol selector synchronized synthesize try" - join() { printf "%s" "$1" | tr -s ' \n' "$2"; } + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=objc %{ diff --git a/rc/core/kakrc.kak b/rc/core/kakrc.kak index cf2b64ea..fc52378b 100644 --- a/rc/core/kakrc.kak +++ b/rc/core/kakrc.kak @@ -40,7 +40,7 @@ evaluate-commands %sh{ types="int bool str regex int-list str-list completions line-specs range-specs" values="default black red green yellow blue magenta cyan white yes no false true" - join() { printf "%s" "$1" | tr -s ' \n' "$2"; } + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } # Add the language's grammar to the static completion list printf '%s\n' "hook global WinSetOption filetype=kak %{ diff --git a/rc/core/sh.kak b/rc/core/sh.kak index caa68720..0840c4f0 100644 --- a/rc/core/sh.kak +++ b/rc/core/sh.kak @@ -19,7 +19,7 @@ evaluate-commands %sh{ readonly return select set shift source test then time type typeset ulimit unalias until while break continue" - join() { printf "%s" "$1" | tr -s ' \n' "$2"; } + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } # Add the language's grammar to the static completion list printf %s\\n "hook global WinSetOption filetype=sh %{