From b84d85272364175b2467958f9d659c7549fc4313 Mon Sep 17 00:00:00 2001 From: Lennard Hofmann Date: Mon, 13 Jan 2020 17:51:18 +0100 Subject: [PATCH] [sh] Merge two %sh blocks into one It simply needed a newline --- rc/filetype/sh.kak | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/rc/filetype/sh.kak b/rc/filetype/sh.kak index 76c50264..bd71acf5 100644 --- a/rc/filetype/sh.kak +++ b/rc/filetype/sh.kak @@ -34,18 +34,6 @@ evaluate-commands %sh{ keywords="if then else elif fi case esac for select while until do done in function time coproc" - join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } - - # Add the language's grammar to the static completion list - printf %s\\n "declare-option str-list sh_static_words $(join "${keywords}" ' ')" - - # Highlight keywords - printf %s "add-highlighter shared/sh/code/ regex \b($(join "${keywords}" '|'))\b 0:keyword" - -} - -# For some reasons this needs to be in its own %sh block -evaluate-commands %sh{ # Generated with `compgen -b` in bash builtins="alias bg bind break builtin caller cd command compgen complete compopt continue declare dirs disown echo enable eval exec @@ -54,10 +42,13 @@ evaluate-commands %sh{ readonly return set shift shopt source suspend test times trap true type typeset ulimit umask unalias unset wait" - join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } + join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } # Add the language's grammar to the static completion list - printf %s\\n "set-option -add global sh_static_words $(join "${builtins}" ' ')" + printf %s\\n "declare-option str-list sh_static_words $(join "${keywords}" ' ') $(join "${builtins}" ' ')" + + # Highlight keywords + printf %s\\n "add-highlighter shared/sh/code/ regex \b($(join "${keywords}" '|'))\b 0:keyword" # Highlight builtins printf %s "add-highlighter shared/sh/code/builtin regex \b($(join "${builtins}" '|'))\b 0:builtin"