From 0076c050fb12c92a35b673d63fca82d5cff63bdb Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Wed, 29 Dec 2010 18:22:52 +0000
Subject: Always print first argument on next line if callee is a list.

git-svn-id: http://svn.drobilla.net/resp/resp@373 ad02d1e2-f140-0410-9f75-f8b11f17cedd
---
 src/pprint.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/pprint.cpp b/src/pprint.cpp
index 7b0ec3c..48debb1 100644
--- a/src/pprint.cpp
+++ b/src/pprint.cpp
@@ -117,17 +117,22 @@ print_to(ostream& out, const AST* ast, unsigned indent, CEnv* cenv, bool types)
 		if (i == tup->end())
 			return out << ")";
 
-		std::string    form       = "";
-		const ASymbol* sym        = (*i)->to_symbol();
-		unsigned       head_width = 1;
+		std::string    form         = "";
+		const ASymbol* sym          = (*i)->to_symbol();
+		unsigned       head_width   = 1;
+		bool           head_is_list = (*i)->to_tuple();
 		if (sym) {
 			form = sym->sym();
 			head_width = form.length() + 2;
 		}
 
 		print_to(out, *i++, indent + 1, cenv, types);
-		if (i != tup->end())
-			out << " ";
+		if (i != tup->end()) {
+			if (head_is_list)
+				newline(out, indent + 1);
+			else
+				out << " ";
+		}
 
 		if (form == "def") {
 			out << (*i++); // Print symbol
-- 
cgit v1.2.1