summaryrefslogtreecommitdiff
path: root/rc/cpp.kak
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-11-05 13:43:29 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-11-05 13:43:29 +0000
commit0d620c3905a120c8646cac0c9eb24fcd56102dd2 (patch)
tree561a005af33aa360494a597f5d1d59d42e606ed5 /rc/cpp.kak
parent4c3056a05e502f73f29178bdee97e5e27608229c (diff)
cpp.kak: tweak cpp-alternative-file implementation
Diffstat (limited to 'rc/cpp.kak')
-rw-r--r--rc/cpp.kak40
1 files changed, 22 insertions, 18 deletions
diff --git a/rc/cpp.kak b/rc/cpp.kak
index e105688d..72c2c890 100644
--- a/rc/cpp.kak
+++ b/rc/cpp.kak
@@ -91,24 +91,28 @@ def cpp-alternative-file -docstring "Jump to the alternate file (header/implemen
dir=$(dirname ${kak_buffile})
case ${file} in
- *.c|*.cc|*.cpp|*.cxx|*.C)
- for alt_dir in ${alt_dirs}; do
- for ext in h hh hpp hxx H; do
- altname="${dir}/${alt_dir}/${file%.*}.${ext}"
- [ -f ${altname} ] && break
- done
- [ -f ${altname} ] && break
- done
- ;;
- *.h|*.hh|*.hpp|*.hxx|*.H)
- for alt_dir in ${alt_dirs}; do
- for ext in c cc cpp cxx C; do
- altname="${dir}/${alt_dir}/${file%.*}.${ext}"
- [ -f ${altname} ] && break
- done
- [ -f ${altname} ] && break
- done
- ;;
+ *.c|*.cc|*.cpp|*.cxx|*.C|*.inl)
+ for alt_dir in ${alt_dirs}; do
+ for ext in h hh hpp hxx H; do
+ altname="${dir}/${alt_dir}/${file%.*}.${ext}"
+ [ -f ${altname} ] && break
+ done
+ [ -f ${altname} ] && break
+ done
+ ;;
+ *.h|*.hh|*.hpp|*.hxx|*.H)
+ for alt_dir in ${alt_dirs}; do
+ for ext in c cc cpp cxx C; do
+ altname="${dir}/${alt_dir}/${file%.*}.${ext}"
+ [ -f ${altname} ] && break
+ done
+ [ -f ${altname} ] && break
+ done
+ ;;
+ *)
+ echo "'extension not recognized'"
+ exit
+ ;;
esac
if [ -f ${altname} ]; then
echo edit "'${altname}'"