zsh-autosuggestions
zsh-autosuggestions copied to clipboard
Fix 'bad math expression' bug
The problem seems to be that when the POSTDISPLAY envvar is not set, $#POSTDISPLAY sometimes evaluates to 0POSTDISPLAY instead of 0.
Using curly braces (i.e. ${#POSTDISPLAY}) to disambiguate should mitigate this issue. This should also be a low-risk change IMO, although I will admit that I have no idea why I am just now seeing this error message.
Fixes #679
I've noticed extremely similar behavior, at one time or another, myself. It might be a good idea to consider doing this for each reference of $#POSTDISPLAY where it could theoretically be unset, since it does show up elsewhere (src/widgets.zsh, src/highlight.zsh, and the _zsh_autosuggest_accept function in the same file). If no one gets around to it I can fork and submit a PR at a later date.