summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command/_w3m
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-11-14 16:19:25 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-11-14 16:19:25 +0000
commitf15627d17b8bbf8c6c3623844be509b544d8a9f6 (patch)
tree01d0e196a8f3ad41b01f2d0fb456a26a75e5a3a1 /Completion/Unix/Command/_w3m
parentunposted: config.guess, config.sub: upgrade to GNU's October 7 versions. (diff)
downloadzsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar
zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.gz
zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.bz2
zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.lz
zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.xz
zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.tar.zst
zsh-f15627d17b8bbf8c6c3623844be509b544d8a9f6.zip
19244: various completion function fixes and updates
Diffstat (limited to 'Completion/Unix/Command/_w3m')
-rw-r--r--Completion/Unix/Command/_w3m39
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