summaryrefslogtreecommitdiff
path: root/rc/detection
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2020-08-23 18:55:50 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2020-08-24 19:01:05 +0200
commit9a7d8df44732b684255acd151c4104bf95aeebd5 (patch)
tree19c3ff9ed6bc0e88c285cc39da0b8e2f5f268d93 /rc/detection
parent4b7fd68d48061cc9c1cbf4a89ae5b2d60937f7e3 (diff)
Avoid accidentally using environment variables in sh scopes
On the instances with altfile this was already the case, but this makes it more obvious. Closes #3673
Diffstat (limited to 'rc/detection')
-rw-r--r--rc/detection/modeline.kak4
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/detection/modeline.kak b/rc/detection/modeline.kak
index 3784a081..1a343448 100644
--- a/rc/detection/modeline.kak
+++ b/rc/detection/modeline.kak
@@ -58,9 +58,8 @@ define-command -hidden modeline-parse-impl %{
case "${kak_selection}" in
*vi:*|*vim:*) type_selection="vim";;
*kak:*|*kakoune:*) type_selection="kakoune";;
- *) echo "echo -debug Unsupported modeline format";;
+ *) echo "echo -debug Unsupported modeline format"; exit 1 ;;
esac
- [ -n "${type_selection}" ] || exit 1
# The following subshell will keep the actual options of the modeline, and strip:
# - the text that leads the first option, according to the official vim modeline format
@@ -82,6 +81,7 @@ define-command -hidden modeline-parse-impl %{
case "${type_selection}" in
vim) tr=$(translate_opt_vim "${name_option}" "${value_option}");;
kakoune) tr=$(translate_opt_kakoune "${name_option}" "${value_option}");;
+ *) tr="";;
esac
[ -n "${tr}" ] && printf %s\\n "${tr}"