Quote:
Had to get home from work to prove to myself that I didn't dream this.
You're right, and my answer (about hitting return inside a quoted string) was wrong. This is both more complicated and buggier than I understood.
The case I was thinking of is this:
Code:
When play begins:
say "Alpha.
Beta.";
If you do this, you'll get a paragraph break (two line breaks) between "Alpha" and "Beta", with no indentation. This is probably what you want. However, it's not what the IDE editor naturally does -- it autoindents when you hit Enter, so you wind up with this:
Code:
When play begins:
say "Alpha.
Beta.";
This was your original complaint, and I misunderstood it. Sorry about that. I was thinking only about the behavior of the compiler, not of the editor. If you go back and delete the indentation before "Beta", you get back to the correct case.
The other reason I was confused was that I had never noticed the behavior of the compiler with a *single* line break. As you note, it collapses the line break *and* any associated indentation into a single space character. That's these cases:
Code:
When play begins:
say "Alpha.
One.";
say "Alpha.
Two.";
I don't know why it converts the line break to a space -- I'd expect it to keep it. But given that it does, it certainly makes sense to drop the indentation, and it should be doing that for the double-line-break case too.
(In fact there's still something hinky going on under the covers. In these latter cases, the I7 compiler is generating I6 string constants which contain literal tab and newline characters -- though not both at the same time, which is even hinkier. These characters then get ironed out into spaces by the *I6* compiler. The result is valid, but the I7 compiler really should be handling it all and not passing the buck.)