Closed Farid-NL closed 1 month ago
A workaround would be to check if $ABBR_USER_ABBREVIATIONS_FILE
has contents:
~/.zshrc
if [[ -s "$ABBR_USER_ABBREVIATIONS_FILE" ]]; then
typeset -A ZSH_HIGHLIGHT_REGEXP
ZSH_HIGHLIGHT_HIGHLIGHTERS+=(regexp)
ZSH_HIGHLIGHT_REGEXP+=('^[[:blank:][:space:]]*('${(j:|:)${(Qk)ABBR_REGULAR_USER_ABBREVIATIONS}}')$' fg=blue,bold,underline)
ZSH_HIGHLIGHT_REGEXP+=('\<('${(j:|:)${(Qk)ABBR_GLOBAL_USER_ABBREVIATIONS}}')$' fg=blue,bold,underline)
fi
Thanks for the report. Good catch!
More reliable than checking for ABBR_USER_ABBREVIATIONS_FILE file contents is to check that there's at least one user abbreviation:
- [[ -s "$ABBR_USER_ABBREVIATIONS_FILE" ]]
+ (( ${#ABBR_REGULAR_USER_ABBREVIATIONS} ))
I've updated the docs https://zsh-abbr.olets.dev/advanced.html#zsh-syntax-highlighting
@Farid-NL I offer to add bug reporters to https://zsh-abbr.olets.dev/community/ and https://github.com/olets/zsh-abbr#community. Do you want to be listed? If so I'll have the all-contributors bot open a PR; you'll need to review it to make sure the info the bot pulls is correct
Thanks for the offer, I'm good.
And thank you for such an awesome zsh plugin!
Is there an existing issue for this?
Update the issue title
Expected Behavior
Deleting characters (specifically the last one) should work as usual when using zsh-syntax-highlighting
Example:
Actual Behavior
The last character cannot be deleted and the terminal 'freezes' (can't type, can't use widgets, etc).
To 'unfreeze' the terminal it is necessary to use CTRL-C.
Steps To Reproduce
With a terminal session with at least 1 abbreviation:
exec zsh
.exec zsh
.Environment
Installation method
Plugin manager
Installation method details
Zsh framework (Plugin manager): zsh4humans (latest)
Installation process:
Anything else?
I place the following code below where zsh-abbr is loaded: