about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-13 10:23:38 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-13 10:23:38 +0000
commit963043760fdda262131532a724f0d6b1606888d5 (patch)
tree510f1b4279360935b988a8b071ed0f3aa1451586 /Doc
parent16ea1f357d02481efa55d5304ab8f452e37ca6b4 (diff)
downloadzsh-963043760fdda262131532a724f0d6b1606888d5.tar.gz
zsh-963043760fdda262131532a724f0d6b1606888d5.tar.xz
zsh-963043760fdda262131532a724f0d6b1606888d5.zip
zsh-workers/10107
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/compwid.yo22
1 files changed, 16 insertions, 6 deletions
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo
index 9a58dc84c..219f1ff0e 100644
--- a/Doc/Zsh/compwid.yo
+++ b/Doc/Zsh/compwid.yo
@@ -796,12 +796,14 @@ more such classes than the other side, the superfluous classes behave
 like normal character classes. In anchor patterns correspondence classes
 also behave like normal character classes.
 
-The pattern var(tpat) may also be a single star, `tt(*)'. This means
-that the pattern on the command line can match any number of characters
-in the trial completion. In this case the pattern must be anchored (on
-either side); the var(anchor) then determines how much of the trial
-completion is to be included --- only the characters up to the next
-appearance of the anchor will be matched.
+The pattern var(tpat) may also be one or two stars, `tt(*)' or
+`tt(**)'. This means that the pattern on the command line can match
+any number of characters in the trial completion. In this case the
+pattern must be anchored (on either side); in the case of a single
+star, the var(anchor) then determines how much of the trial completion
+is to be included --- only the characters up to the next appearance of
+the anchor will be matched. With two stars, substrings matched by the
+anchor can be matched, too.
 
 Examples:
 
@@ -863,6 +865,14 @@ likewise for the second dot, and replaces the empty strings before the
 anchors, giving tt(c)[tt(omp)]tt(.s)[tt(ources)]tt(.u)[tt(nix)], where
 the last part of the completion is just as normal.
 
+With the pattern shown above, the string `tt(c.u)' could not be
+completed to `tt(comp.sources.unix)' because the single star means
+that no dot (matched by the anchor) can be skipped. By using two stars 
+as in `tt(r:|.=**)', however, `tt(c.u)' could be completed to
+`tt(comp.sources.unix)'. This also shows that in some cases,
+especially if the anchor is a real pattern, like a character class,
+the form with two stars may result in more matches than one would like.
+
 The second specification is needed to make this work when the cursor is
 in the middle of the string on the command line and the option
 tt(COMPLETE_IN_WORD) is set. In this case the completion code would