Hi, the given example in the zshzle man page does not follow the suggestion to check substrings in $ZLE_STATE in alphabetically order. (For reference: The alphabetically sorting was introduced in 30425.) > The substrings are sorted in alphabetical order so that if you want to test for two specific > substrings in a future-proof way, you can do match by doing: > > if [[ $ZLE_STATE == *insert*globalhistory* ]]; then ...; fi With the attached path the example works now as intended; credit for discovering that bug in the doc goes to Volker Siegel (http://superuser.com/questions/691925/zsh-how-to-zle-widgets-directly/691935#comment1060599_691935). ---Manuel. diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 2a907c5..e586536 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -948,7 +948,7 @@ The substrings are sorted in alphabetical order so that if you want to test for two specific substrings in a future-proof way, you can do match by doing: -example(if [[ $ZLE_STATE == *insert*globalhistory* ]]; then ...; fi) +example(if [[ $ZLE_STATE == *globalhistory*insert* ]]; then ...; fi) ) enditem()
Attachment:
zle.yo.patch
Description: Binary data