cursive
cursive copied to clipboard
Long strings in REPL output interpret \\n as line breaks
Issue
Long string values that contain a backslash \\
followed by the letter n
will incorrectly output in the REPL with line breaks.
Repro
- Navigate to Preferences, Languages & Frameworks, Clojure.
- Note your Preferences, Editor, Code Style, Hard wrap at X columns setting. For this example, we'll say that it's set to 120 characters
- On the right-hand side make sure "Pretty print REPL return values" and "Split and align multi-line strings" are both checked.
- Evaluate a long text string literal (must be longer than the editor's "Hard wrap" at X columns setting) that has a backslash
\\
character followed by the lettern
:
"C:\\some-really-long-path\\that-would-make-the-string-wrap\\and-is-followed-by-a-part-that-starts-with-the-letter-n\\new.txt"
Expected Output
"C:\\some-really-long-path\\that-would-make-the-string-wrap\\and-is-followed-by-a-part-that-starts-with-the-letter-n\\new.txt"
Actual Output
"C:\\some-really-long-path\\that-would-make-the-string-wrap\\and-is-followed-by-a-part-that-starts-with-the-letter-n\
ew.txt"
Notes
It's subtle, but "\\n"
gets converted to a backslash and newline instead of a backslash and the n
character.