Formatting fix

This commit is contained in:
Maxime Coste 2015-07-03 21:14:34 +01:00
parent 742fdc1f7d
commit 9e39aab325

View File

@ -31,20 +31,20 @@ def -shell-params runtime %{ %sh{
}} }}
def -shell-params -docstring "colorscheme <name>: enable named colorscheme" \ def -shell-params -docstring "colorscheme <name>: enable named colorscheme" \
-shell-completion %{ -shell-completion %{
prefix=${1:0:${kak_pos_in_token}} prefix=${1:0:${kak_pos_in_token}}
( (
for col in ${kak_runtime}/colors/*.kak; do for col in ${kak_runtime}/colors/*.kak; do
expr $(basename "${col}" .kak) : "^\(${prefix}.*\)$" expr $(basename "${col}" .kak) : "^\(${prefix}.*\)$"
done done
) | grep -v '^$' ) | grep -v '^$'
} \ } \
colorscheme %{ %sh{ colorscheme %{ %sh{
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
echo "source '${kak_runtime}/colors/$1.kak'" echo "source '${kak_runtime}/colors/$1.kak'"
else else
echo -color Error 'Usage: colorscheme <scheme name>' echo -color Error 'Usage: colorscheme <scheme name>'
fi fi
}} }}
%sh{ %sh{