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

Re: Bug#163190: zsh: Bad indentation in displayed shell function (whence -f)



> That looks fine. You'd want to do the same for { ... } (WC_CURSH) too of
> course.

Okay, committing this one.

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	13 Nov 2002 21:06:10 -0000
@@ -345,27 +345,31 @@
 	    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;
 	case WC_CURSH:
 	    if (!s) {
-		taddstr("{ ");
+		taddstr("{");
 		tindent++;
+		taddnl();
 		n = tpush(code, 1);
 		n->u._subsh.end = state->pc + WC_CURSH_SKIP(code);
 	    } else {
 		state->pc = s->u._subsh.end;
 		tindent--;
-		taddstr(" }");
+		taddnl();
+		taddstr("}");
 		stack = 1;
 	    }
 	    break;



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