diff options
author | Mikael Magnusson <mikachu@gmail.com> | 2022-02-23 19:45:43 +0100 |
---|---|---|
committer | Mikael Magnusson <mikachu@gmail.com> | 2022-03-08 19:37:21 +0100 |
commit | 28410bd5bc71fda6343b13c2b6abad06bd2eaaee (patch) | |
tree | 891d21c22d6aeef87327cf5554283de1453c7f34 | |
parent | ee1d622042015d9eb56bfd616163e82ffb7e5b4f (diff) | |
download | zsh-28410bd5bc71fda6343b13c2b6abad06bd2eaaee.tar.gz zsh-28410bd5bc71fda6343b13c2b6abad06bd2eaaee.tar.xz zsh-28410bd5bc71fda6343b13c2b6abad06bd2eaaee.zip |
promptinit: only exclude current theme from preview if no arguments are given
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Functions/Prompts/promptinit | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index 35e8693ac..fd2b2bb34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-03-08 Mikael Magnusson <mikachu@gmail.com> + + * 49773: Functions/Prompts/promptinit: promptinit: only exclude + current theme from preview if no arguments are given + 2022-03-06 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> * 49802 (+ 49804:Daniel): Test/W03jobparameters.ztst: pass diff --git a/Functions/Prompts/promptinit b/Functions/Prompts/promptinit index 20503d78b..0c06699e8 100644 --- a/Functions/Prompts/promptinit +++ b/Functions/Prompts/promptinit @@ -73,7 +73,7 @@ set_prompt() { Options: -c Show currently selected theme and parameters -l List currently available prompt themes - -p [<themes>] Preview given themes (defaults to all) + -p [<themes>] Preview given themes (defaults to all except current theme) -h [<theme>] Display help (for given theme) -s <theme> Set and save theme <theme> Switch to new theme immediately (changes not saved) @@ -120,10 +120,9 @@ Use prompt -h <theme> for help on specific themes.' print $prompt_themes return ;; - p) preview=( $prompt_themes ) + p) preview=( ${prompt_themes:#$prompt_theme} ) (( $#* > 1 )) && preview=( "$@[2,-1]" ) for theme in $preview; do - [[ "$theme" == "$prompt_theme[*]" ]] && continue prompt_preview_safely "$=theme" done print -P "%b%f%k" |