Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Avoid using short_loops syntax in distributed files



36312 reminded me I've been holding on to this patch for a few years.
This is the only remaining instance in the distribution, it would be
nice if I could zcompile my $fpath without doing this:

setopt localoptions
for dir in $fpath; do
  if [[ $dir = /usr/* ]]; then
    setopt shortloops
  else
    setopt noshortloops
  fi
  zrecompile -p $dir.zwc $dir/*(-.) && rm -f $dir.zwc.old
done

---
 Functions/Prompts/prompt_bart_setup | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Functions/Prompts/prompt_bart_setup b/Functions/Prompts/prompt_bart_setup
index 45fcffe..22c0c03 100644
--- a/Functions/Prompts/prompt_bart_setup
+++ b/Functions/Prompts/prompt_bart_setup
@@ -178,7 +178,7 @@ prompt_bart_setup () {
     typeset -gA fg
 
     # A few extra niceties ...
-    repeat 1 case "$1:l" in
+    repeat 1; do case "$1:l" in
       (off|disable)
 	add-zsh-hook -D precmd "prompt_*_precmd"
 	add-zsh-hook -D preexec "prompt_*_preexec"
@@ -201,7 +201,7 @@ prompt_bart_setup () {
 	fg[%D]="%F{${4:-default}}"
 	fg[%@]="%F{${1:-red}}"
 	;;
-    esac
+    esac; done
 
     prompt_bart_ps1
 
-- 
2.5.0



Messages sorted by: Reverse Date, Date, Thread, Author