Recently I updated to the newest version of IntelliJ IDEA 14.1.4 Ultimate. Since this update it automatically splits lines for me which is very annoying because I'd like to do that by myself manually.
Example: I might be typing something like this:
throw new IllegalArgumentException("You can only provide one vararg/optional parameter to the end of this method!");
And while typing intellij automatically continues on a new line:
throw new IllegalArgumentException("You can only provide one vararg/optional parameter to the end of this" +
" method!");
Now this might seem fine, but is really annoying when intelli decides to do it when you are writing a decimal double for example as it creates errors like this:
How can I disable this feature/modify this behaviour?
You can drag a tab vertically or horizontally in order to split the editor, and drag the tab back to unsplit the screen.
Right-click the left gutter and from the context menu, either select or clear the Soft-Wrap Current Editor option.
Press ⇧⌘A (on Mac) or Control+Shift+A (on Windows/Linux) to open the Find Action dialog, and search for "soft-wrap". We get the option to turn on soft-wrap, which will be for this file only. You can click this option to turn soft-wrap on or off.
Go to Intellij Settings and follow the instructions on these two pictures:
You can edit the Code Style Settings at:
File > Settings > Editor > Code Style > Java > Wrapping and Braces
There are different options, for your problem set Right margin column to 300 or something like this or just uncheck Ensure right margin it not exceeded. You can also experiment with them.
Press Ctrl + Alt + L
to format afterwards. Unfortunately once IntelliJ has wrapped the lines I am not sure if it unwraps them on its own, maybe you have to fix this.
Please consider when changing line length etc. that sometimes line length is needed due to Code Conventions, Checkstyle and those... :)
Update Screenshot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With