Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Repeatable (@M) bug



Hello

Summary description: searching for "xyza" doesn't match "xyza", only "xyzab"

Illustration by code:
---------
list=( "aisj" )
echo "1 |${(@M)list:#*aisj*}"
list=( "aisj" "aisja" )
echo "2 |${(@M)list:#*aisja*}"
echo "3 |${(@M)list:#*aisj*}"
list=( "aisj" "aisja" "aisjas" )
echo "4 |${(@M)list:#*aisjas*}"
echo "5 |${(@M)list:#*aisja*}"
echo "6 |${(@M)list:#*aisj*}"
---------

This example works. "aisj" returns "aisj", "aisja" returns "aisja", "aisj"
returns "aisja" AND "aisj", etc. However in a script the same steps yield
the erroneous behavior: "aisj" matches only "aisja" and "aisjas", and
"aisja" matches only "aisjas".

The script is:
https://github.com/psprint/zsh-visual-tools/

It is really simple. It allows to grep for a pattern when displaying
history. Calling the script extends history content - like the 'list=(
"aisj" "aisja" )' lines. Equivalent of the code already mentioned is:

v-list aisj
No matching history entries
v-list aisja
No matching history entries
v-list aisj
(matches only aisja)
v-history aisjas
No matching history entries
v-history aisja
(matches only aisjas)
v-history aisj
(matches only aisja and aisjas)

Also, when I wrote a script to repeat v-history calls automatically (no
through command line) it resulted in:
v-history:fc:21: no such event: 1000

This is a very interesting result, as the `history -rn 1000` call just must
work.

I checked this on OSX 5.0.2 and hombrew's 5.0.8-dev-1.

PS. What I mean by the last mentioned script is:

#!/bin/zsh

autoload v-history

v-history aisj
v-history aisja
v-history aisj
v-history aisjas
v-history aisja
v-history aisj

Best Regards,
Sebastian


Messages sorted by: Reverse Date, Date, Thread, Author