about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2014-05-16 09:39:25 +0100
committerPeter Stephenson <pws@zsh.org>2014-05-16 09:39:25 +0100
commit3ff598bf4623c5e8dadbdcd95b7fa7e2d7ae1ef6 (patch)
treef44a51bd391a6ca5b5a6c87f93fc46af703f5ae5 /Doc
parent9d47e8398d299e53ffe4e7ddf3731d2fedae9948 (diff)
downloadzsh-3ff598bf4623c5e8dadbdcd95b7fa7e2d7ae1ef6.tar.gz
zsh-3ff598bf4623c5e8dadbdcd95b7fa7e2d7ae1ef6.tar.xz
zsh-3ff598bf4623c5e8dadbdcd95b7fa7e2d7ae1ef6.zip
users/18827 plus tweaks to original comments: hg bookmarks extraction improvement
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/contrib.yo17
1 files changed, 5 insertions, 12 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 9f59f231d..ce5493218 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -1504,22 +1504,15 @@ function +vi-hgbookmarks+LPAR()RPAR() {
     # This makes the bookmarks string use only those
     # bookmarks. If there's more than one, it
     # concatenates them using commas.
-    local s i
     # The bookmarks returned by `hg' are available in
-    # the functions positional parameters.
-    (( $# == 0 )) && return 0
-    for i in "$@"; do
-        if [[ $i == sh/* ]]; then
-            [[ -n $s ]] && s=$s,
-            s=${s}$i
-        fi
-    done
+    # the function's positional parameters.
+    local s="${(Mj:,:)@:#sh/*}"
     # Now, the communication with the code that calls
     # the hook functions is done via the hook_com[]
-    # hash. The key, at which the `gen-hg-bookmark-string'
-    # hook looks at is `hg-bookmark-string'. So:
+    # hash. The key at which the `gen-hg-bookmark-string'
+    # hook looks is `hg-bookmark-string'. So:
     hook_com[hg-bookmark-string]=$s
-    # And to signal, that we want to use the sting we
+    # And to signal that we want to use the string we
     # just generated, set the special variable `ret' to
     # something other than the default zero:
     ret=1