diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-17 11:59:32 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-17 11:59:32 +0000 |
commit | 05d3c175a5f9d1eb7bd8ed5f9c36ff5838ee6b8e (patch) | |
tree | 3efe3a37fc8b26b2dbafc2441558ebe9a525cf37 /Doc | |
parent | cd4b5eac3a2291f0a96493ae5cac666268638832 (diff) | |
download | zsh-05d3c175a5f9d1eb7bd8ed5f9c36ff5838ee6b8e.tar.gz zsh-05d3c175a5f9d1eb7bd8ed5f9c36ff5838ee6b8e.tar.xz zsh-05d3c175a5f9d1eb7bd8ed5f9c36ff5838ee6b8e.zip |
add Felix' completion matching test; some fixes for bugs shown by it (11439)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Zsh/compwid.yo | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index 162e1af1b..4614e4bd6 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -958,17 +958,21 @@ determined by a leading uppercase letter) or maybe one has to complete strings with trailing numbers. Here one could use the simple form with only one anchor as in: -example(compadd -M 'r:|[A-Z0-9]=* r:|=*' LikeTHIS FooHoo foo123 bar234) - -But with this, the string `tt(H)' would be completed to `tt(FooHoo)' -em(and) `tt(LikeTHIS)' and `tt(2)' would be completed to the other two +example(compadd -M 'r:|[A-Z0-9]=* r:|=*' LikeTHIS FooHoo 5foo123 5bar234) + +But with this, the string `tt(H)' would neither complete to `tt(FooHoo)' +nor to `tt(LikeTHIS)' because in each case there is an uppercase +letter before the `tt(H)' and that is matched by the anchor. Likewise, +a `tt(2)' would not be completed. In both cases this could be changed +by using `tt(r:|[A-Z0-9]=**)', but then `tt(H)' completes to both +`tt(LikeTHIS)' and `tt(FooHoo)' and a `tt(2)' matches the other strings because characters can be inserted before every uppercase letter and digit. To avoid this one would use: -example(compadd -M 'r:[^A-Z0-9]||[A-Z0-9]=* r:|=*' \ +example(compadd -M 'r:[^A-Z0-9]||[A-Z0-9]=** r:|=*' \ LikeTHIS FooHoo foo123 bar234) -By using these two anchors, a `tt(H)' matches only uppercase `H's that +By using these two anchors, a `tt(H)' matches only uppercase `tt(H)'s that are immediately preceded by something matching the left anchor `tt([^A-Z0-9])'. The effect is, of course, that `tt(H)' matches only the string `tt(FooHoo)', a `tt(2)' matches only `tt(bar234)' and so on. |