Merge remote-tracking branch 'occivink/alt-fail'

This commit is contained in:
Maxime Coste 2019-10-09 19:18:45 +11:00
commit e4f815e350
4 changed files with 12 additions and 12 deletions

View File

@ -428,11 +428,11 @@ define-command -hidden c-family-alternative-file %{
done done
;; ;;
*) *)
echo "echo -markup '{Error}extension not recognized'" echo "fail 'extension not recognized'"
exit exit
;; ;;
esac esac
echo "echo -markup '{Error}alternative file not found'" echo "fail 'alternative file not found'"
} }
} }

View File

@ -54,7 +54,7 @@ define-command lua-alternative-file -docstring 'Jump to the alternate file (impl
case $kak_buffile in case $kak_buffile in
*spec/*_spec.lua) *spec/*_spec.lua)
altfile=$(eval printf %s\\n $(printf %s\\n $kak_buffile | sed s+spec/+'*'/+';'s/_spec//)) altfile=$(eval printf %s\\n $(printf %s\\n $kak_buffile | sed s+spec/+'*'/+';'s/_spec//))
[ ! -f $altfile ] && echo "echo -markup '{Error}implementation file not found'" && exit [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit
;; ;;
*.lua) *.lua)
path=$kak_buffile path=$kak_buffile
@ -66,10 +66,10 @@ define-command lua-alternative-file -docstring 'Jump to the alternate file (impl
break break
fi fi
done done
[ ! -d $altdir ] && echo "echo -markup '{Error}spec/ not found'" && exit [ ! -d $altdir ] && echo "fail 'spec/ not found'" && exit
;; ;;
*) *)
echo "echo -markup '{Error}alternative file not found'" && exit echo "fail 'alternative file not found'" && exit
;; ;;
esac esac
printf %s\\n "edit $altfile" printf %s\\n "edit $altfile"

View File

@ -56,7 +56,7 @@ define-command moon-alternative-file -docstring 'Jump to the alternate file (imp
case $kak_buffile in case $kak_buffile in
*spec/*_spec.moon) *spec/*_spec.moon)
altfile=$(eval printf %s\\n $(printf %s\\n $kak_buffile | sed s+spec/+'*'/+';'s/_spec//)) altfile=$(eval printf %s\\n $(printf %s\\n $kak_buffile | sed s+spec/+'*'/+';'s/_spec//))
[ ! -f $altfile ] && echo "echo -markup '{Error}implementation file not found'" && exit [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit
;; ;;
*.moon) *.moon)
path=$kak_buffile path=$kak_buffile
@ -68,10 +68,10 @@ define-command moon-alternative-file -docstring 'Jump to the alternate file (imp
break break
fi fi
done done
[ ! -d $altdir ] && echo "echo -markup '{Error}spec/ not found'" && exit [ ! -d $altdir ] && echo "fail 'spec/ not found'" && exit
;; ;;
*) *)
echo "echo -markup '{Error}alternative file not found'" && exit echo "fail 'alternative file not found'" && exit
;; ;;
esac esac
printf %s\\n "edit $altfile" printf %s\\n "edit $altfile"

View File

@ -102,11 +102,11 @@ define-command ruby-alternative-file -docstring 'Jump to the alternate file (imp
case $kak_buffile in case $kak_buffile in
*spec/*_spec.rb) *spec/*_spec.rb)
altfile=$(eval echo $(echo $kak_buffile | sed s+spec/+'*'/+';'s/_spec//)) altfile=$(eval echo $(echo $kak_buffile | sed s+spec/+'*'/+';'s/_spec//))
[ ! -f $altfile ] && echo "echo -markup '{Error}implementation file not found'" && exit [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit
;; ;;
*test/*_test.rb) *test/*_test.rb)
altfile=$(eval echo $(echo $kak_buffile | sed s+test/+'*'/+';'s/_test//)) altfile=$(eval echo $(echo $kak_buffile | sed s+test/+'*'/+';'s/_test//))
[ ! -f $altfile ] && echo "echo -markup '{Error}implementation file not found'" && exit [ ! -f $altfile ] && echo "fail 'implementation file not found'" && exit
;; ;;
*.rb) *.rb)
path=$kak_buffile path=$kak_buffile
@ -119,10 +119,10 @@ define-command ruby-alternative-file -docstring 'Jump to the alternate file (imp
break break
fi fi
done done
[ ! -d $altdir ] && echo "echo -markup '{Error}spec/ and test/ not found'" && exit [ ! -d $altdir ] && echo "fail 'spec/ and test/ not found'" && exit
;; ;;
*) *)
echo "echo -markup '{Error}alternative file not found'" && exit echo "fail 'alternative file not found'" && exit
;; ;;
esac esac
echo "edit $altfile" echo "edit $altfile"