From c4c093d764848160b9f43074e19b940732edec0b Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sun, 2 May 2021 11:24:17 +0200 Subject: [PATCH] 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. --- rc/tools/doc.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/tools/doc.kak b/rc/tools/doc.kak index 42bae6f6..111cfe1b 100644 --- a/rc/tools/doc.kak +++ b/rc/tools/doc.kak @@ -125,6 +125,8 @@ define-command -params 1 -hidden doc-render %{ # Remove escaping of * and ` try %{ execute-keys -draft s \\((?=\*)|(?=`)) d } + # Go to beginning of file + execute-keys 'gg' set-option buffer readonly true add-highlighter buffer/ ranges doc_render_ranges @@ -184,7 +186,7 @@ define-command -params 0..2 \ fi printf %s\\n "evaluate-commands -try-client %opt{docsclient} %{ doc-render ${page}; ${jump_cmd} }" else - printf 'fail No such doc file: %s\n' "${page}" + printf 'fail No such doc file: %s\n' "$topic.asciidoc" fi } }