zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Cc: Vincent Lefevre <vincent@vinc17.org>, 163190-forwarded@bugs.debian.org
Subject: Re: Bug#163190: zsh: Bad indentation in displayed shell function (whence -f)
Date: Fri, 4 Oct 2002 17:46:00 -0400	[thread overview]
Message-ID: <20021004214600.GA27515@dman.com> (raw)
In-Reply-To: <E17x37s-0005VN-00@ay>

In the following example, the subshell commands are not indented
uniformly.

> $ blah() { ( echo; echo; echo ) }
> $ whence -f blah
> blah () {
>         ( echo
>                 echo
>                 echo )
> }

Here's one possible fix.  Thoughts?

Index: Src/text.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/text.c,v
retrieving revision 1.11
diff -u -r1.11 text.c
--- Src/text.c	7 Jun 2002 14:44:25 -0000	1.11
+++ Src/text.c	4 Oct 2002 21:43:16 -0000
@@ -345,14 +345,16 @@
 	    break;
 	case WC_SUBSH:
 	    if (!s) {
-		taddstr("( ");
+		taddstr("(");
 		tindent++;
+		taddnl();
 		n = tpush(code, 1);
 		n->u._subsh.end = state->pc + WC_SUBSH_SKIP(code);
 	    } else {
 		state->pc = s->u._subsh.end;
 		tindent--;
-		taddstr(" )");
+		taddnl();
+		taddstr(")");
 		stack = 1;
 	    }
 	    break;


       reply	other threads:[~2002-10-04 21:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E17x37s-0005VN-00@ay>
2002-10-04 21:46 ` Clint Adams [this message]
2002-10-25 13:01   ` Oliver Kiddle
2002-11-13 21:06     ` Clint Adams

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20021004214600.GA27515@dman.com \
    --to=clint@zsh.org \
    --cc=163190-forwarded@bugs.debian.org \
    --cc=vincent@vinc17.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.vuxu.org/mirror/zsh/

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).