diff options
Diffstat (limited to 'Completion/X')
-rw-r--r-- | Completion/X/_x_color | 2 | ||||
-rw-r--r-- | Completion/X/_x_cursor | 2 | ||||
-rw-r--r-- | Completion/X/_x_display | 2 | ||||
-rw-r--r-- | Completion/X/_x_extension | 2 | ||||
-rw-r--r-- | Completion/X/_x_font | 2 | ||||
-rw-r--r-- | Completion/X/_x_keysym | 2 | ||||
-rw-r--r-- | Completion/X/_x_modifier | 2 | ||||
-rw-r--r-- | Completion/X/_x_window | 2 | ||||
-rw-r--r-- | Completion/X/_xmodmap | 10 |
9 files changed, 22 insertions, 4 deletions
diff --git a/Completion/X/_x_color b/Completion/X/_x_color index 0cbcdf0eb..4c1c73bf4 100644 --- a/Completion/X/_x_color +++ b/Completion/X/_x_color @@ -29,6 +29,8 @@ if (( ! $+_color_cache )); then (( $#_color_cache )) || _color_cache=(white black gray red blue green) fi +_tags any colors || return 1 + _description expl 'color specification' compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} m:-=\ r:|[ A-Z0-9]=* r:|=*' - \ "$_color_cache[@]" diff --git a/Completion/X/_x_cursor b/Completion/X/_x_cursor index 59ecb5976..a22189f9d 100644 --- a/Completion/X/_x_cursor +++ b/Completion/X/_x_cursor @@ -14,5 +14,7 @@ if (( ! $+_cursor_cache )); then fi fi +_tags any cursors || return 1 + _description expl 'cursor name' compadd "$@" "$expl[@]" -M 'm:-=_ r:|_=*' - "$_cursor_cache[@]" diff --git a/Completion/X/_x_display b/Completion/X/_x_display index e3f9af479..7b9fbab9a 100644 --- a/Completion/X/_x_display +++ b/Completion/X/_x_display @@ -1,3 +1,5 @@ #autoload +_tags any displays || return 1 + _hosts -S ':0 ' -r : diff --git a/Completion/X/_x_extension b/Completion/X/_x_extension index 967938e28..44e47d956 100644 --- a/Completion/X/_x_extension +++ b/Completion/X/_x_extension @@ -2,6 +2,8 @@ local expl +_tags any extensions || return 1 + (( $+_xe_cache )) || _xe_cache=( "${(@)${(@f)$(xdpyinfo)}[(r)number of extensions:*,-1][2,(r)default screen number:*][1,-2]//[ ]}" ) _description expl 'X extension' diff --git a/Completion/X/_x_font b/Completion/X/_x_font index 4ba21ddff..f4dfef79c 100644 --- a/Completion/X/_x_font +++ b/Completion/X/_x_font @@ -2,6 +2,8 @@ local expl +_tags any fonts || return 1 + # This *has* to be improved some day... if (( ! $+_font_cache )); then diff --git a/Completion/X/_x_keysym b/Completion/X/_x_keysym index 6b031014a..fc2847c57 100644 --- a/Completion/X/_x_keysym +++ b/Completion/X/_x_keysym @@ -2,6 +2,8 @@ local expl +_tags any keysyms || return 1 + if (( ! $+_keysym_cache )); then local file diff --git a/Completion/X/_x_modifier b/Completion/X/_x_modifier index a9276ab71..345243835 100644 --- a/Completion/X/_x_modifier +++ b/Completion/X/_x_modifier @@ -2,6 +2,8 @@ local expl +_tags any modifiers || return 1 + _description expl modifier compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z}' - \ Shift Lock Control Mod1 Mod2 Mod3 Mod4 Mod5 diff --git a/Completion/X/_x_window b/Completion/X/_x_window index 65d2b72e2..6d6e3112e 100644 --- a/Completion/X/_x_window +++ b/Completion/X/_x_window @@ -2,6 +2,8 @@ local list expl +_tags any windows || return 1 + list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" ) if [[ "$1" = -n ]]; then diff --git a/Completion/X/_xmodmap b/Completion/X/_xmodmap index 4e7a8bfc8..d8ba420ce 100644 --- a/Completion/X/_xmodmap +++ b/Completion/X/_xmodmap @@ -1,6 +1,6 @@ #compdef xmodmap -local state line ret=1 +local context state line ret=1 typeset -A opt_args _x_arguments \ @@ -82,9 +82,11 @@ if [[ -n "$state" ]]; then [[ "$what" = *ksym* ]] && _x_keysym "$suf[@]" && ret=0 else - _description expl command - compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0 - compadd "$expl[@]" -S ' = ' pointer && ret=0 + if _tags any commands; then + _description expl command + compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0 + compadd "$expl[@]" -S ' = ' pointer && ret=0 + fi fi fi |