Closed sorawee closed 6 years ago
Ugh. We've discussed this at length. The consensus was, there simply is no good answer here. "Do what Python does to fix excess whitespace" was the best idea, but even that algorithm is sufficiently complicated that it's hard to predict what it does. You were the one who told us that that approach was a bad idea -- https://github.com/brownplt/pyret-lang/issues/639#issuecomment-181497359 ;-)
Since the primary use of TQS was doc: strings, and we don't do anything semantic with them right now anyway, this isn't a big problem. I'm closing this as a dupe, and "just another piece of the pain that is TQS." :-(
Say I write
(where
|
indicates the cursor)After I hit the enter key, I get
After I add more text and hit the enter key, I get
which suggests to users that Pyret wants them to write like this:
But this evaluates to
which is not what users would want.
Even when a block of text is copied over from external sources, the indenter still formats it:
Text:
Code:
After indenting all lines
Note that
doesn't help either because this formats to:
I think there are two ways to fix this: