From 2d9bd96ae262b9bab5418b9c102a4014690902a7 Mon Sep 17 00:00:00 2001 From: ed9w2in6 Date: Thu, 17 Apr 2025 18:53:42 +0800 Subject: [PATCH] allow running zsh with set -u (no unset var) I have been using this for a while. It makes me feel safer by turning on set -u by default, which abort on unset var This line seems to be the only one tripping set -u so this is a very simple change. --- zsh-autosuggestions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index e780225..3819cfb 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -255,7 +255,7 @@ _zsh_autosuggest_highlight_reset() { _zsh_autosuggest_highlight_apply() { typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT - if (( $#POSTDISPLAY )); then + if (( ${#POSTDISPLAY-} )); then typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT="$#BUFFER $(($#BUFFER + $#POSTDISPLAY)) $ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE" region_highlight+=("$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT") else