From 08873a779a757adfea3369303433f8b746d429c4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 28 Mar 2013 14:28:15 +0100 Subject: [PATCH] cpp.kak: fix alt_dirs handling with more than 2 directories --- src/rc/cpp.kak | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak index 372a02f9..f38e5b25 100644 --- a/src/rc/cpp.kak +++ b/src/rc/cpp.kak @@ -38,7 +38,7 @@ decl str-list alt_dirs ".,.." def alt %{ %sh{ shopt -s extglob - alt_dirs=${kak_opt_alt_dirs/,/ } + alt_dirs=${kak_opt_alt_dirs//,/ } file=$(basename ${kak_bufname}) dir=$(dirname ${kak_bufname}) @@ -46,13 +46,13 @@ def alt %{ %sh{ *.c|*.cc|*.cpp|*.cxx|*.C) for alt_dir in ${alt_dirs}; do altname=$(ls -1 "${dir}/${alt_dir}/${file%.*}".@(h|hh|hpp|hxx|H) 2> /dev/null | head -n 1) - [[ -n ${altname} ]] && break + [[ -e ${altname} ]] && break done ;; *.h|*.hh|*.hpp|*.hxx|*.H) for alt_dir in ${alt_dirs}; do altname=$(ls -1 "${dir}/${alt_dir}/${file%.*}".@(c|cc|cpp|cxx|C) 2> /dev/null | head -n 1) - [[ -n ${altname} ]] && break + [[ -e ${altname} ]] && break done ;; esac