mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 10:41:11 +02:00
users/18827 plus tweaks to original comments: hg bookmarks extraction improvement
This commit is contained in:
parent
9d47e8398d
commit
3ff598bf46
2 changed files with 11 additions and 12 deletions
|
@ -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>
|
2014-05-13 Barton E. Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* 32609: Src/parse.c, Test/CO2cond.ztst: [[ $var ]] behaves as
|
* 32609: Src/parse.c, Test/CO2cond.ztst: [[ $var ]] behaves as
|
||||||
|
|
|
@ -1504,22 +1504,15 @@ function +vi-hgbookmarks+LPAR()RPAR() {
|
||||||
# This makes the bookmarks string use only those
|
# This makes the bookmarks string use only those
|
||||||
# bookmarks. If there's more than one, it
|
# bookmarks. If there's more than one, it
|
||||||
# concatenates them using commas.
|
# concatenates them using commas.
|
||||||
local s i
|
|
||||||
# The bookmarks returned by `hg' are available in
|
# The bookmarks returned by `hg' are available in
|
||||||
# the functions positional parameters.
|
# the function's positional parameters.
|
||||||
(( $# == 0 )) && return 0
|
local s="${(Mj:,:)@:#sh/*}"
|
||||||
for i in "$@"; do
|
|
||||||
if [[ $i == sh/* ]]; then
|
|
||||||
[[ -n $s ]] && s=$s,
|
|
||||||
s=${s}$i
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
# Now, the communication with the code that calls
|
# Now, the communication with the code that calls
|
||||||
# the hook functions is done via the hook_com[]
|
# the hook functions is done via the hook_com[]
|
||||||
# hash. The key, at which the `gen-hg-bookmark-string'
|
# hash. The key at which the `gen-hg-bookmark-string'
|
||||||
# hook looks at is `hg-bookmark-string'. So:
|
# hook looks is `hg-bookmark-string'. So:
|
||||||
hook_com[hg-bookmark-string]=$s
|
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
|
# just generated, set the special variable `ret' to
|
||||||
# something other than the default zero:
|
# something other than the default zero:
|
||||||
ret=1
|
ret=1
|
||||||
|
|
Loading…
Reference in a new issue