diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-09-28 17:46:37 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2016-10-07 13:56:31 +0000 |
commit | 7ad0001183688c56bd1edfc8fc08467e380910a4 (patch) | |
tree | 7df8833fee6f39f5a77dacec68f5824077418886 /Completion/X | |
parent | a96e34b459d55240b0f4af37ac73aca916720883 (diff) | |
download | zsh-7ad0001183688c56bd1edfc8fc08467e380910a4.tar.gz zsh-7ad0001183688c56bd1edfc8fc08467e380910a4.tar.xz zsh-7ad0001183688c56bd1edfc8fc08467e380910a4.zip |
39479 + 39481 minus _path_files hunk (see 39489): Completion: audit 'compset -P' calls to use shortest match where applicable, plus random drive-by tweaks.
Found by grepping for patterns that can match needles of various lengths: :grep 'compset -[PS].*[\#^*()\|<>?~\]' Completion/
Diffstat (limited to 'Completion/X')
-rw-r--r-- | Completion/X/Command/_rdesktop | 3 | ||||
-rw-r--r-- | Completion/X/Command/_x_utils | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/Completion/X/Command/_rdesktop b/Completion/X/Command/_rdesktop index 5e480b333..55a6ea7b5 100644 --- a/Completion/X/Command/_rdesktop +++ b/Completion/X/Command/_rdesktop @@ -89,9 +89,8 @@ case $state in ;; redirection) redir="${PREFIX%%:*}" - if compset -P '*='; then + if compset -P 1 '*='; then curcontext="${curcontext%:*}:$redir" - compset -P '*=' case $redir in comport|lptport) _wanted devices expl device _files -g '*(-%)' && ret=0 ;; disk) _directories && ret=0 ;; diff --git a/Completion/X/Command/_x_utils b/Completion/X/Command/_x_utils index ebc6aacbf..13c5572af 100644 --- a/Completion/X/Command/_x_utils +++ b/Completion/X/Command/_x_utils @@ -82,12 +82,16 @@ xev) xhost) local type tmp match + if [[ -z $PREFIX ]]; then + _describe prefixes '(-:disallow +:allow)' -S '' -r '' + fi + if compset -P '-'; then tmp=(${(f)"$(xhost)"}) shift tmp tmp=(${tmp:#LOCAL:|<*>}) if [[ "$tmp" = *:* ]]; then - if compset -P '(#b)(*):'; then + if compset -P 1 '(#b)(*):'; then type="$match[1]" _tags displays while _tags; do @@ -118,7 +122,7 @@ xhost) if [[ "$PREFIX" = *:* ]]; then type="${(L)PREFIX%%:*}" - compset -P '*:' + compset -P 1 '*:' case "$type" in inet) _hosts && ret=0;; |