Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#163190: zsh: Bad indentation in displayed shell function (whence -f)
- X-seq: zsh-workers 17770
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#163190: zsh: Bad indentation in displayed shell function (whence -f)
- Date: Fri, 4 Oct 2002 17:46:00 -0400
- Cc: Vincent Lefevre <vincent@xxxxxxxxxx>, 163190-forwarded@xxxxxxxxxxxxxxx
- In-reply-to: <E17x37s-0005VN-00@ay>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <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;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author