Merge remote-tracking branch 'occivink/c-alt-absolute' into master

This commit is contained in:
Maxime Coste 2020-11-08 14:48:42 +11:00
commit d1c27ad126

View File

@ -415,7 +415,10 @@ define-command -hidden c-family-alternative-file %{
*.c|*.cc|*.cpp|*.cxx|*.C|*.inl|*.m) *.c|*.cc|*.cpp|*.cxx|*.C|*.inl|*.m)
for alt_dir in "$@"; do for alt_dir in "$@"; do
for ext in h hh hpp hxx H; do for ext in h hh hpp hxx H; do
altname="${dir}/${alt_dir}/${file_noext}.${ext}" case "$alt_dir" in
/*) altname="${alt_dir}/${file_noext}.${ext}" ;;
*) altname="${dir}/${alt_dir}/${file_noext}.${ext}" ;;
esac
if [ -f ${altname} ]; then if [ -f ${altname} ]; then
printf 'edit %%{%s}\n' "${altname}" printf 'edit %%{%s}\n' "${altname}"
exit exit
@ -426,7 +429,10 @@ define-command -hidden c-family-alternative-file %{
*.h|*.hh|*.hpp|*.hxx|*.H) *.h|*.hh|*.hpp|*.hxx|*.H)
for alt_dir in "$@"; do for alt_dir in "$@"; do
for ext in c cc cpp cxx C m; do for ext in c cc cpp cxx C m; do
altname="${dir}/${alt_dir}/${file_noext}.${ext}" case "$alt_dir" in
/*) altname="${alt_dir}/${file_noext}.${ext}" ;;
*) altname="${dir}/${alt_dir}/${file_noext}.${ext}" ;;
esac
if [ -f ${altname} ]; then if [ -f ${altname} ]; then
printf 'edit %%{%s}\n' "${altname}" printf 'edit %%{%s}\n' "${altname}"
exit exit