cpp.kak: tweak cpp-alternative-file implementation

This commit is contained in:
Maxime Coste 2014-11-05 13:43:29 +00:00
parent 4c3056a05e
commit 0d620c3905

View File

@ -91,7 +91,7 @@ def cpp-alternative-file -docstring "Jump to the alternate file (header/implemen
dir=$(dirname ${kak_buffile}) dir=$(dirname ${kak_buffile})
case ${file} in case ${file} in
*.c|*.cc|*.cpp|*.cxx|*.C) *.c|*.cc|*.cpp|*.cxx|*.C|*.inl)
for alt_dir in ${alt_dirs}; do for alt_dir in ${alt_dirs}; do
for ext in h hh hpp hxx H; do for ext in h hh hpp hxx H; do
altname="${dir}/${alt_dir}/${file%.*}.${ext}" altname="${dir}/${alt_dir}/${file%.*}.${ext}"
@ -109,6 +109,10 @@ def cpp-alternative-file -docstring "Jump to the alternate file (header/implemen
[ -f ${altname} ] && break [ -f ${altname} ] && break
done done
;; ;;
*)
echo "'extension not recognized'"
exit
;;
esac esac
if [ -f ${altname} ]; then if [ -f ${altname} ]; then
echo edit "'${altname}'" echo edit "'${altname}'"