Fix plugin for shells with no_unset shell option (aka set -u) set

This commit is contained in:
Erin Schlarb 2022-11-02 21:31:09 +00:00 committed by GitHub
parent a411ef3e09
commit 9e8e2427e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ _zsh_autosuggest_highlight_reset() {
_zsh_autosuggest_highlight_apply() {
typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT
if (( $#POSTDISPLAY )); then
if [[ -v POSTDISPLAY && ${#POSTDISPLAY} -gt 0 ]]; then
typeset -g _ZSH_AUTOSUGGEST_LAST_HIGHLIGHT="$#BUFFER $(($#BUFFER + $#POSTDISPLAY)) $ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE"
region_highlight+=("$_ZSH_AUTOSUGGEST_LAST_HIGHLIGHT")
else