JaredCS
JaredCS

Reputation: 505

Intellij wrap .java file text at certain length just for me. No '\n','\r', etc. saved to files. Word Wrap like notepad

I like to format my code such that I can see everything without having to scroll to the right. However, my monitor size is smaller than others on my team so when I format it they get early returns and don't like the extra white space. If they format it, I still can't see all the text without scrolling to the right. It would be nice if we could keep the text all on one line and intlleij would automatically wrap the text according to our editing window size. Just like when you turn on word wrap in notepad. Is there a way to do this in intellij? I put some examples below of the problem kind of looks like and what the fix would kind of look like.

!=where the window cuts off.

problem examples:

Teams screens when I format:

    /* 
       Lorem ipsum dolor sit amet,           !
       consectetur adipiscing elit.          !
       Cras vel imperdiet augue.             !     
       Aenean d                              !
    */

My screen when they format:

    /* 
       Lorem ipsum dolor sit amet, consectetu!r adipiscing elit.          
       Cras vel imperdiet augue.Aenean d     !     
    */

Fix examples

My screen

    /* 
       Lorem ipsum dolor sit amet, !
       consectetur adipiscing elit.!
       Cras vel imperdiet augue.   !     
       Aenean d                    !
    */

Teams screen

    /* 
       Lorem ipsum dolor sit amet, consectetur adipiscing elit.!          
       Cras vel imperdiet augue.Aenean d                       !
    */

Upvotes: 1

Views: 262

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 402305

Settings (Preferences on macOS) | Editor | General | Soft-wrap these files. Add ; *.java to the list.

Upvotes: 2

Related Questions