From 9a19f18bc09e961f5ecef11cc922b6632e818197 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 5 Sep 2016 23:39:13 +0100 Subject: [PATCH] Use shell-candidates for :colorscheme completion --- share/kak/kakrc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/share/kak/kakrc b/share/kak/kakrc index e92d3815..df3674bf 100644 --- a/share/kak/kakrc +++ b/share/kak/kakrc @@ -6,18 +6,15 @@ def -params 1.. runtime %{ %sh{ }} def -params 1 -docstring "colorscheme : enable named colorscheme" \ - -shell-completion %{ - prefix=$(printf %s "$1" | cut -c1-${kak_pos_in_token} 2> /dev/null) - ( + -shell-candidates %{ localconfdir=${XDG_CONFIG_HOME:-${HOME}/.config}/kak for col in ${kak_runtime}/colors/*.kak ${localconfdir}/colors/*.kak; do candidate=$(basename "${col}" .kak) case ${candidate} in \**) ;; - ${prefix}*) echo ${candidate} ;; + *) echo ${candidate} ;; esac done - ) | sort -u } \ colorscheme %{ %sh{ localconfdir=${XDG_CONFIG_HOME:-${HOME}/.config}/kak