diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2003-10-27 11:17:29 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2003-10-27 11:17:29 +0000 |
commit | 026631ab818995ad480a9ea3e5a7ec243c645db1 (patch) | |
tree | b014a0525153feffcbf8d97aa8b3f3353da5e251 /Completion/Unix | |
parent | 112bfcfe46a0b5f2781f3b0131e25b78b0e9ed0c (diff) | |
download | zsh-026631ab818995ad480a9ea3e5a7ec243c645db1.tar.gz zsh-026631ab818995ad480a9ea3e5a7ec243c645db1.tar.xz zsh-026631ab818995ad480a9ea3e5a7ec243c645db1.zip |
zsh-users/6727 (Lloyd Zusman): improve _w3m
Diffstat (limited to 'Completion/Unix')
-rw-r--r-- | Completion/Unix/Command/.distfiles | 1 | ||||
-rw-r--r-- | Completion/Unix/Command/_w3m | 19 | ||||
-rw-r--r-- | Completion/Unix/Command/_w3mhistory | 10 |
3 files changed, 16 insertions, 14 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index 04e83bead..33d62a6b9 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -23,4 +23,5 @@ _perforce _python _antiword _screen _renice _apm _ecasound _gpg _subversion _aap _sablotron _nmap _chmod _du _nice _rar _vorbis +_w3mhistory ' diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index 70ac75e4c..683a9f67d 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -1,6 +1,6 @@ #compdef w3m -local curcontext="$curcontext" state line ret=1 +local curcontext="$curcontext" state line typeset -A opt_args _arguments -C \ @@ -31,19 +31,10 @@ _arguments -C \ '-o[option]:option-value:' \ '-config:config file:_files' \ '-debug' \ - ':url:->url' && ret=0 + ':url:->html' && return 0 case $state in - url) - local _w3mhistory - - if [[ -s ~/.w3m/history ]]; then - _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"}) - compadd $_w3mhistory && ret=0 - fi - - _urls -f && ret=0 - ;; + html) + _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_w3mhist' + ;; esac - -return ret diff --git a/Completion/Unix/Command/_w3mhistory b/Completion/Unix/Command/_w3mhistory new file mode 100644 index 000000000..f0f944138 --- /dev/null +++ b/Completion/Unix/Command/_w3mhistory @@ -0,0 +1,10 @@ +#autoload + +local _w3mhistory + +if [[ -s ~/.w3m/history ]]; then + _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"}) + compadd $_w3mhistory +fi + +_urls -f |