zdharma-continuum / fast-syntax-highlighting

Feature-rich syntax highlighting for ZSH
BSD 3-Clause "New" or "Revised" License
1.06k stars 76 forks source link

avoid errors unbound variables and unset parameters #50

Closed LucasLarson closed 1 year ago

LucasLarson commented 1 year ago

Description

zsh prints an abundance of errors when setopt nounset is enabled and fast-syntax-highlighting is activated. This commit helps to avoid the unnecessary verbosity and fix #49. cases where variables were referenced using $var and where zsh5.9 --no-unset complained about it have been modified to use ${var-} syntax

Related Issue

49

How Has This Been Tested?

I tested my changes manually using my default login shell (zsh -u at the moment) with my changes to my local copy of the plugin.

Types of changes

Checklist:

pschmitt commented 1 year ago

Lgtm.