diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-11-14 16:19:25 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-11-14 16:19:25 +0000 |
commit | f15627d17b8bbf8c6c3623844be509b544d8a9f6 (patch) | |
tree | 01d0e196a8f3ad41b01f2d0fb456a26a75e5a3a1 /Completion/Unix/Command/_w3m | |
parent | ddb1a1d92f8187ba8b47e496e05f538cfc33285c (diff) | |
download | zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.gz zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.xz zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.zip |
19244: various completion function fixes and updates
Diffstat (limited to 'Completion/Unix/Command/_w3m')
-rw-r--r-- | Completion/Unix/Command/_w3m | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index 02a995a92..1106d5987 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -1,24 +1,23 @@ #compdef w3m -local curcontext="$curcontext" state line ret=1 +local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args -_arguments \ +_arguments -C \ '-t[tabwidth]:tabwidth:' \ '-r[ignore backspace effect]' \ '-l[preserved lines]:number of lines:' \ '-B[load bookmark]' \ '-bookmark:bookmark file:_files' \ - '-T[content-type]:content type:' \ + '-T[content-type]:content type' \ '-m[internet message mode]' \ '-v[visual startup mode]' \ '-M[monochrome display]' \ '-F[automatically render frame]' \ '(-dump_source -dump_head)-dump' \ - '-cols:column width:' \ + '-cols:column width' \ '(-dump -dump_head)-dump_source' \ '(-dump -dump_source)-dump_head' \ - '+:goto line:' \ '-num[show line number]' \ '-no-proxy' \ '-no-mouse' \ @@ -28,23 +27,25 @@ _arguments \ '-S[squeeze multiple blank lines]' \ '-W[toggle wrap search mode]' \ '-X[do not use termcap init/deinit]' \ - '-o[option]:option-value:' \ + '-o[option]:option-value' \ '-config:config file:_files' \ '-debug' \ - ':url:->url' && ret=0 + ':url:->html' \ + '+:goto line' && ret=0 -case $state in - url) - local _w3mhistory +if [[ -n $state ]]; then + local w3mhistory - if [[ -s ~/.w3m/history ]]; then - _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"}) - compadd $_w3mhistory && ret=0 - fi - - _urls -f && ret=0 - ;; - -esac + _tags files w3mhistory urls + while _tags; do + _requested files expl 'file' _files -g "*.x#html" && ret=0 + _requested urls expl 'url' _urls && ret=0 + if [[ -s ~/.w3m/history ]] && _requested w3mhistory; then + w3mhistory=( ${(f)"$(<~/.w3m/history)"} ) + _all_labels w3mhistory expl 'url from history' compadd -a w3mhistory + fi + (( ret )) || break + done +fi return ret |