diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2016-10-22 21:53:21 -0700 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2016-10-22 21:53:21 -0700 |
commit | 8e3e72793363a7d209af9c6a98b992e76aecc6c3 (patch) | |
tree | a9991034b124f1114d9b4f33ad041c0713472776 | |
parent | 11343d89efcb027b4a8855b58e2636f7c983241f (diff) | |
download | zsh-8e3e72793363a7d209af9c6a98b992e76aecc6c3.tar.gz zsh-8e3e72793363a7d209af9c6a98b992e76aecc6c3.tar.xz zsh-8e3e72793363a7d209af9c6a98b992e76aecc6c3.zip |
39710 (cf. Alex George: 39709): handle the %o format in the "all-expansions" tag
Also allow a single unique match to appear in the "expansions" tag of _expand in the same way as _user_expand (users/21955 commit 18200dc0)
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Completion/Base/Completer/_expand | 9 | ||||
-rw-r--r-- | Completion/Base/Completer/_user_expand | 7 |
3 files changed, 20 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index bbe5f7590..cb35290b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-10-22 Barton E. Schaefer <schaefer@zsh.org> + + * 39710 (cf. Alex George: 39709): Completion/Base/Completer/_expand, + Completion/Base/Completer/_user_expand: handle the %o format in the + "all-expansions" tag; allow a single unique match to appear in the + "expansions" tag (cf. users/21955). + 2016-10-20 Peter Stephenson <p.stephenson@samsung.com> * 39688: Src/pattern.c: Alternative fix: next pointer is diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand index e52144cb7..a6e30e891 100644 --- a/Completion/Base/Completer/_expand +++ b/Completion/Base/Completer/_expand @@ -181,7 +181,7 @@ if [[ -z "$compstate[insert]" ]] ;then else _tags all-expansions expansions original - if [[ $#exp -gt 1 ]] && _requested expansions; then + if [[ $#exp -ge 1 ]] && _requested expansions; then local i j normal space dir if [[ "$sort" = menu ]]; then @@ -207,9 +207,14 @@ else (( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal fi - if _requested all-expansions expl 'all expansions'; then + if _requested all-expansions; then local disp dstr + if [[ "$sort" = menu ]]; then + _description all-expansions expl 'all expansions' "o:$word" + else + _description -V all-expansions expl 'all expansions' "o:$word" + fi if [[ "${#${exp}}" -ge COLUMNS ]]; then disp=( -ld dstr ) dstr=( "${(r:COLUMNS-5:)exp} ..." ) diff --git a/Completion/Base/Completer/_user_expand b/Completion/Base/Completer/_user_expand index 066e2e8e5..ee39bb176 100644 --- a/Completion/Base/Completer/_user_expand +++ b/Completion/Base/Completer/_user_expand @@ -121,9 +121,14 @@ else (( $#space )) && compadd "$expl[@]" -UQ -qS " " -a space (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal fi - if _requested all-expansions expl "all expansions${REPLY:+: $REPLY}"; then + if _requested all-expansions; then local disp dstr + if [[ "$sort" = menu ]]; then + _description all-expansions expl "all expansions${REPLY:+: $REPLY}" "o:$word" + else + _description -V all-expansions expl "all expansions${REPLY:+: $REPLY}" "o:$word" + fi if [[ "${#${exp}}" -ge COLUMNS ]]; then disp=( -ld dstr ) dstr=( "${(r:COLUMNS-5:)exp} ..." ) |