From a9ce93143927173ec29cf08994467bea32b95e28 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Thu, 2 Nov 2017 19:24:56 -0500 Subject: [PATCH] Default possibly unset variables to empty --- tests/test-highlighting.zsh | 2 +- zsh-syntax-highlighting.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-highlighting.zsh b/tests/test-highlighting.zsh index d29880d..ed7dff9 100755 --- a/tests/test-highlighting.zsh +++ b/tests/test-highlighting.zsh @@ -49,7 +49,7 @@ # Set up results_filter local results_filter -if [[ $QUIET == y ]]; then +if [[ ${QUIET-} == y ]]; then if type -w perl >/dev/null; then results_filter=${0:A:h}/tap-filter else diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 47288c5..b708a7c 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -188,7 +188,7 @@ _zsh_highlight_apply_zle_highlight() { integer first="$3" second="$4" # read the relevant entry from zle_highlight - local region="${zle_highlight[(r)${entry}:*]}" + local region="${zle_highlight[(r)${entry}:*]-}" if [[ -z "$region" ]]; then # entry not specified at all, use default value