Fork me on GitHub
#cursive
<
2022-01-04
>
GuessBurger20:01:37

I spotted something strange with Cursive's REPL. I was having issues with some string formatting code I was writing and while debugging I found the cause was that when I eval " a \n b " it appears to trim the whitespace after the newline on the returned string to " a \nb ". This is the case whether a function returns that value or just the string is eval-ed but println-ing works fine (see screenshot). A colleague also reported seeing the same thing. Is there a flag we have checked that's causing this? I've looked through my settings and tried searching for it on the Cursive site but can't find anything.

cfleming20:01:24

I should add a section to the Troubleshooting page about this, sorry, that’s Preferences | Languages &amp; Frameworks | Clojure | REPL Options | Split and align multi-line strings

GuessBurger21:01:27

No problem, I obviously didn't look close enough 😅 Thank you for getting back to me so quickly!

cfleming21:01:50

No worries! That’s so that when you print out data structures containing formatted strings, they look nice. That’s useful, but for the case where you’re actually developing code that depends on formatted strings, it can be weird.

cfleming21:01:01

I’ve updated the doc for this, it’ll go out on the next push.

👍 1
imre19:09:51

Hey Colin, has this doc update ever gone out?

imre19:09:02

I can't seem to find it

cfleming21:09:30

I can’t either 😕

cfleming21:09:46

I’ll check to see if it’s lost in a branch somewhere or something. Otherwise I’ll just rewrite it.

cfleming21:09:58

This is a tricky one, because when that setting is doing what it’s intended, it works well enough that you don’t normally notice it happening. But it can be very frustrating when it’s not doing what you expect. I’ll think about ways to make it more obvious what’s happening.