diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-05-02 15:19:50 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-05-02 15:19:50 +0000 |
commit | 53d36e795b26a945048e7a87a1a91224f8e1663a (patch) | |
tree | aee8b11f48f2af1aceacd4a279f1d4b1de6ebfa6 /Completion/Core/_oldlist | |
parent | 206237c8ec4b7619d9e70a75004cd1ae1066b0a0 (diff) | |
download | zsh-53d36e795b26a945048e7a87a1a91224f8e1663a.tar.gz zsh-53d36e795b26a945048e7a87a1a91224f8e1663a.tar.xz zsh-53d36e795b26a945048e7a87a1a91224f8e1663a.zip |
zsh-3.1.5-pws-17 dot-zsh-199905041932
Diffstat (limited to 'Completion/Core/_oldlist')
-rw-r--r-- | Completion/Core/_oldlist | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Completion/Core/_oldlist b/Completion/Core/_oldlist new file mode 100644 index 000000000..f42197695 --- /dev/null +++ b/Completion/Core/_oldlist @@ -0,0 +1,29 @@ +#autoload + +# If this is a listing widget and there is already an old list, +# and either the compconfig key oldlist_list is `always', or it is not `never' +# and the list is not already shown, then use the existing list for listing +# (even if it was generated by another widget). +if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never && + $WIDGET = *list* && + ( $compconfig[oldlist_list] = always || $compstate[old_list] != shown ) ]] +then + compstate[old_list]=keep + return 0 +fi + +# If this is a completion widget, and we have a completion inserted already, +# and the compconfig key oldlist_menu is not never, then we cycle through the +# existing list (even if it was generated by another widget). +if [[ -n $compstate[old_insert] && $WIDGET = *complete(|-prefix|-word) && + $compconfig[oldlist_menu] != never ]]; then + compstate[old_list]=keep + if [[ $WIDGET = *reverse* ]]; then + compstate[insert]=$(( compstate[old_insert] - 1 )) + else + compstate[insert]=$(( compstate[old_insert] + 1 )) + fi + return 0 +fi + +return 1 |