Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _setxbmap: fix variants
- X-seq: zsh-workers 38780
- From: arno <arno@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _setxbmap: fix variants
- Date: Sat, 2 Jul 2016 14:18:10 -0700
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
In _setxkbmap_variant, the script looks for the pattern *xkb_symbols*\"([[:alnum:]])
This prevent variants containing non alphanumeric symbols to be included in the completion. For example,
$ setxkbmap us <Tab>
fails to suggest altgr-intl, classmate-intl, cz_sk_de, dvorak-classic, dvorak-r, intl-unicode, workman-intl, alt-intl, classmate-altgr-intl, dvorak-intl, sun_type6, alt-intl-
unicode, classmate-alt-intl, dvorak-alt-intl and dvorak-l variants
This patch fixes this issue by looking for pattern *xkb_symbols*\"([^\"])
It also replaces # compdef setxkbmap by #compdef setxkbmap. The spurious space prevented the completion to be loaded in the first place.
diff --git a/Completion/X/Command/_setxkbmap b/Completion/X/Command/_setxkbmap
index c490a9d..d192cc1 100644
--- a/Completion/X/Command/_setxkbmap
+++ b/Completion/X/Command/_setxkbmap
@@ -1,4 +1,4 @@
-# compdef setxkbmap
+#compdef setxkbmap
# TODO:
# model, option, symbols and types suggestions
@@ -90,7 +90,7 @@ _setxkbmap_variant () {
fi
lines=("${(f)$(< ${file})}")
- variants=(${${${(M)lines:#*xkb_symbols*\"([[:alnum:]])##\"*}##*xkb_symbols([^\"])##\"}%%\"*})
+ variants=(${${${(M)lines:#*xkb_symbols*\"([^\"])##\"*}##*xkb_symbols([^\"])##\"}%%\"*})
_wanted variant expl 'variant' compadd -a variants
Messages sorted by:
Reverse Date,
Date,
Thread,
Author