From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8707 invoked from network); 4 Oct 2002 21:46:11 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 4 Oct 2002 21:46:11 -0000 Received: (qmail 29316 invoked by alias); 4 Oct 2002 21:46:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17770 Received: (qmail 29304 invoked from network); 4 Oct 2002 21:46:03 -0000 Date: Fri, 4 Oct 2002 17:46:00 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Cc: Vincent Lefevre , 163190-forwarded@bugs.debian.org Subject: Re: Bug#163190: zsh: Bad indentation in displayed shell function (whence -f) Message-ID: <20021004214600.GA27515@dman.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) 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;