rc modeline: Use more idiomatic shell

This commit is contained in:
Frank LENORMAND 2020-09-16 12:05:30 +03:00
parent 7731fe4cb2
commit 30ee97386d

View File

@ -42,7 +42,9 @@ define-command -hidden modeline-parse-impl %{
| kak -p "${kak_session}";; | kak -p "${kak_session}";;
esac 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 # Pass a few whitelisted options to kakoune directly
@ -82,7 +84,9 @@ define-command -hidden modeline-parse-impl %{
name_option="${option%%=*}" name_option="${option%%=*}"
value_option="${option#*=}" value_option="${option#*=}"
[ -z "${option}" ] && continue if [ -z "${option}" ]; then
continue
fi
case "${type_selection}" in case "${type_selection}" in
vim) tr=$(translate_opt_vim "${name_option}" "${value_option}");; vim) tr=$(translate_opt_vim "${name_option}" "${value_option}");;
@ -90,7 +94,9 @@ define-command -hidden modeline-parse-impl %{
*) tr="";; *) tr="";;
esac esac
[ -n "${tr}" ] && printf %s\\n "${tr}" if [ -n "${tr}" ]; then
printf %s\\n "${tr}"
fi
done done
} }
} }