rc doc: Fix the anchor jump error message

Fixes #2442
This commit is contained in:
Frank LENORMAND 2018-09-30 10:43:09 +03:00
parent 93f913705a
commit 798a7ec351

View File

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