1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-02 08:21:09 +01:00

users/26557: add bookmarks support and remove the header from the final list in surfraw completion

This commit is contained in:
Marc Chantreux 2021-02-27 16:27:35 +01:00 committed by Oliver Kiddle
parent fc82e8193b
commit 7518b20a01
2 changed files with 21 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2021-03-31 Oliver Kiddle <opk@zsh.org>
* Marc Chantreux: users/26557: Completion/Unix/Command/_surfraw:
add bookmarks support and remove the header from the final list
2021-03-29 Aleksandr Mezin <mezin.alexander@gmail.com>
* 47561 (the git and cvs parts) (compare 44919 + 44920):

View file

@ -424,12 +424,26 @@ case $state in
yubnub)
_message -e command 'Yubnub Command'
;;
*)
_message -e string 'search string'
;;
esac
;;
elvi)
local -UT XDG_CONFIG_DIRS xcd
# as it starts with a space, the header becomes an empty
# string removed by the list expansion
_wanted elvi expl elvi compadd \
${${${(f)"$(_call_program elvi surfraw -elvi)"}%%[[:space:]]##--*}%:*} && ret=0
${${(f)"$(surfraw -elvi)"}%%[[:space:]]*} $(
# extract the keys of all bookmarks (should be in surfraw itself)
awk '{keys[$1]=1} END {for (k in keys) print k}' \
$^xcd/surfraw/bookmarks(Nr) \
/etc/xdg/surfraw/bookmarks(Nr) \
/etc/surfraw.bookmarks(Nr) \
${XDG_CONFIG_HOME-${HOME?homeless}/.config}/surfraw/bookmarks(Nr) \
${HOME?homeless}/.surfraw.bookmarks(Nr)
) && ret=0
;;
esac
esac
return ret