Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ disable automatic line splitting

Tags:

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: enter image description here

How can I disable this feature/modify this behaviour?

like image 961
Czarek Avatar asked Jul 23 '15 07:07

Czarek


People also ask

How do I turn off split screen in IntelliJ?

You can drag a tab vertically or horizontally in order to split the editor, and drag the tab back to unsplit the screen.

How do I turn off word wrap in IntelliJ?

Right-click the left gutter and from the context menu, either select or clear the Soft-Wrap Current Editor option.

How do I enable soft wrap in IntelliJ?

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.


2 Answers

Go to Intellij Settings and follow the instructions on these two pictures:

Click Here

like image 52
Toufiqul Avatar answered Sep 28 '22 01:09

Toufiqul


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: Margin

like image 22
mambax Avatar answered Sep 28 '22 00:09

mambax