cursive icon indicating copy to clipboard operation
cursive copied to clipboard

pretty-printed REPL strings do not respect OS line separator

Open bobisageek opened this issue 2 years ago • 0 comments

Issue

Wrapped and pretty-printed multi-line strings appear to break on \n, regardless of the system line separator (presumably only really noticeable on Windows).

This is sort of tangentially related to #2704 , in the sense that it appears to pertain to the same line-splitting mechanism.

Repro Environment

  • Windows
  • IntelliJ Build #IU-221.5787.30
  • Cursive 1.12.4-2022.1
  • Hard wrap at X characters on (using 100 for the example)
  • In Languages & Frameworks, Clojure, Pretty print return values and Split and align multi-line strings enabled

Repro Case

  • In the REPL, return some long string with a Windows line separator, "\r\n":
(->> (apply str (repeat 49 \.))
  (repeat 2)
  (str/join (System/lineSeparator)))

Expected output (with wrapping):

".................................................
 ................................................."

Actual output:

".................................................\r
 ................................................."

If we str/join with "\n" instead of the system line separator, the result is the expected output.

For me, this is a very low priority and not breaking anything - primarily noted for the sake of "if you happen to be working on that section already...".

bobisageek avatar Jun 14 '22 03:06 bobisageek