Closed njordhov closed 4 years ago
You should be able to use \u{0A}
with the new string support. Not sure the 0
is required, although \n
is shorter...
although \n is shorter...
... and likely the escape expected/recognized by many developers for newline.
Thank you @njordhov! This issue was addressed with https://github.com/blockstack/stacks-blockchain/pull/1779 (https://github.com/blockstack/stacks-blockchain/pull/1779/commits/0e995a99156f85b2b23e918af9af601572b70575). Will close, feel free to re-open if you had something different in mind.
@lgalabru Thanks for taking care of implementing the newline escape. Are newline characters still allowed in strings or restricted to the escape character? I favor the latter for Clarity.
String literals should support a
\n
escape character for newline.Currently, line breaks in string literals are typed as actual newline characters, violating the formatting/indent of the code and obfuscating whitespace trailing the line before the newline:
With newline escapes: