diff options
| author | Frank LENORMAND <lenormf@gmail.com> | 2020-09-16 12:05:30 +0300 |
|---|---|---|
| committer | Frank LENORMAND <lenormf@gmail.com> | 2020-09-18 14:54:57 +0300 |
| commit | 30ee97386d2bd8d0240803c8a0fb2f57285a9d4c (patch) | |
| tree | 2e34a0b23e8bac10759ac29057dc57d3652ffc5a | |
| parent | 7731fe4cb27d32ede8b4961b10c63645377fe4ad (diff) | |
rc modeline: Use more idiomatic shell
| -rw-r--r-- | rc/detection/modeline.kak | 12 |
1 files 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 } } |
