diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Doc/Zsh/contrib.yo | 17 |
2 files changed, 11 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog index a50a756c9..8e1c37479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-05-16 Peter Stephenson <p.stephenson@samsung.com> + + * Roman Neuhauser: users/18827 (plus tweaks to original + comments): Doc/Zsh/contrib.yo: more efficient way of extracting + hg bookmarks. + 2014-05-13 Barton E. Schaefer <schaefer@zsh.org> * 32609: Src/parse.c, Test/CO2cond.ztst: [[ $var ]] behaves as 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 |