doc: small UX improvements.
Place the cursor at the beginning of the file (and not at the end of the first line) and improve error message in case of failure.
This commit is contained in:
parent
47c0d20388
commit
c4c093d764
|
@ -125,6 +125,8 @@ define-command -params 1 -hidden doc-render %{
|
||||||
|
|
||||||
# Remove escaping of * and `
|
# Remove escaping of * and `
|
||||||
try %{ execute-keys -draft <percent> s \\((?=\*)|(?=`)) <ret> d }
|
try %{ execute-keys -draft <percent> s \\((?=\*)|(?=`)) <ret> d }
|
||||||
|
# Go to beginning of file
|
||||||
|
execute-keys 'gg'
|
||||||
|
|
||||||
set-option buffer readonly true
|
set-option buffer readonly true
|
||||||
add-highlighter buffer/ ranges doc_render_ranges
|
add-highlighter buffer/ ranges doc_render_ranges
|
||||||
|
@ -184,7 +186,7 @@ define-command -params 0..2 \
|
||||||
fi
|
fi
|
||||||
printf %s\\n "evaluate-commands -try-client %opt{docsclient} %{ doc-render ${page}; ${jump_cmd} }"
|
printf %s\\n "evaluate-commands -try-client %opt{docsclient} %{ doc-render ${page}; ${jump_cmd} }"
|
||||||
else
|
else
|
||||||
printf 'fail No such doc file: %s\n' "${page}"
|
printf 'fail No such doc file: %s\n' "$topic.asciidoc"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user