From 61366fd1ef6f089aa8d32a5b9500bdb51c139dcb Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Wed, 3 Jun 2020 15:47:46 +0300 Subject: [PATCH] rc man: Handle early window resize If the window gets resized before the `man` command is called, the hook will error out and display an error. Fix #3432 --- rc/tools/man.kak | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rc/tools/man.kak b/rc/tools/man.kak index af736485..54960a23 100644 --- a/rc/tools/man.kak +++ b/rc/tools/man.kak @@ -27,8 +27,11 @@ hook global WinSetOption filetype=man %{ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window man-hooks } } -define-command -hidden -params 2..3 man-impl %{ evaluate-commands %sh{ +define-command -hidden -params ..3 man-impl %{ evaluate-commands %sh{ buffer_name="$1" + if [ -z "${buffer_name}" ]; then + exit + fi shift manout=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX) manerr=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX)