From 30ee97386d2bd8d0240803c8a0fb2f57285a9d4c Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Wed, 16 Sep 2020 12:05:30 +0300 Subject: [PATCH] rc modeline: Use more idiomatic shell --- rc/detection/modeline.kak | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rc/detection/modeline.kak b/rc/detection/modeline.kak index 7c436061..516080db 100644 --- a/rc/detection/modeline.kak +++ b/rc/detection/modeline.kak @@ -42,7 +42,9 @@ define-command -hidden modeline-parse-impl %{ | kak -p "${kak_session}";; esac - [ -n "${tr}" ] && printf %s\\n "set-option buffer ${tr}" + if [ -n "${tr}" ]; then + printf 'set-option buffer %s\n' "${tr}" + fi } # Pass a few whitelisted options to kakoune directly @@ -82,7 +84,9 @@ define-command -hidden modeline-parse-impl %{ name_option="${option%%=*}" value_option="${option#*=}" - [ -z "${option}" ] && continue + if [ -z "${option}" ]; then + continue + fi case "${type_selection}" in vim) tr=$(translate_opt_vim "${name_option}" "${value_option}");; @@ -90,7 +94,9 @@ define-command -hidden modeline-parse-impl %{ *) tr="";; esac - [ -n "${tr}" ] && printf %s\\n "${tr}" + if [ -n "${tr}" ]; then + printf %s\\n "${tr}" + fi done } }