help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: PATCH: promptinit: only exclude current theme from preview if no arguments are given
Date: Wed, 23 Feb 2022 19:54:10 +0100	[thread overview]
Message-ID: <20220223185410.12499-1-mikachu@gmail.com> (raw)

Noticed it's actually quite confusing to run
% prompt -p mikachu

and get no output, therefore only exclude the current theme from the
default set, not from explicitly given arguments.

 Functions/Prompts/promptinit | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Functions/Prompts/promptinit b/Functions/Prompts/promptinit
index 20503d78b6..0c06699e8c 100644
--- a/Functions/Prompts/promptinit
+++ b/Functions/Prompts/promptinit
@@ -73,7 +73,7 @@ set_prompt() {
     -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
-    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"
        print -P "%b%f%k"

                 reply	other threads:[~2022-02-23 18:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223185410.12499-1-mikachu@gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).