Merge remote-tracking branch 'lenormf/fix-doc-anchor'

This commit is contained in:
Maxime Coste 2018-10-01 11:18:20 +10:00
commit 150ee05077

View File

@ -59,13 +59,15 @@ define-command doc-jump-to-anchor -params 1 %{
evaluate-commands %sh{
anchor="$1"
eval "set -- $kak_opt_doc_anchors"
shift
for range in "$@"; do
if [ "${range#*|}" == "$anchor" ]; then
printf '%s\n' "select '${range%|*}'; execute-keys vv"
exit
fi
done
printf '%s\n' "echo -markup %{{Error}No such anchor '$1'}"
printf "echo -markup {Error}No such anchor '%s'" "${anchor}"
}
}