summaryrefslogtreecommitdiff
path: root/Completion/Unix
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/.distfiles1
-rw-r--r--Completion/Unix/Command/_w3m19
-rw-r--r--Completion/Unix/Command/_w3mhistory10
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