leiflundberg
leiflundberg

Reputation: 344

How can I stop IntelliJ IDEA printing an empty new line?

I am following the Atomic Kotlin course. I have understood the concept and my output is correct, however Intellij IDEA complains that the outputs are different. Even when I copy and paste from the answer. Please see screenshot. incorrect output

I have tried using the print() method instead of println(), but it didn't help.

Upvotes: 2

Views: 1348

Answers (2)

Peter
Peter

Reputation: 5164

Go to Settings->Editor->General and uncheck the Ensure every line.. property.

see the following screenshot (updated, thx to @Flobesst): enter image description here

Upvotes: 3

Artyom Degtyarev
Artyom Degtyarev

Reputation: 2888

There is a straightforward workaround on how one can avoid this problem. Changing the AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt manually to add a new line at the end of the text should fix the test.
I've also found a YouTrack ticket with the problem description. According to it, EduTools 4.2 version release should fix it. Maybe it worth to upvote or comment on the ticket.

Upvotes: 1

Related Questions