Disable auto line breaking in Java Formatter - VSCODE

1.4k views Asked by At

I need to disable this auto line break my code in Java VS CODE Formatter

It's wrong

enter image description here

Expected:

enter image description here

1

There are 1 answers

1
Molly Wang-MSFT On

This is because you open the wordWrap, but your current code length exceeds the max-length which has been set by default.

There're two solutions to your question, writing it in Settings.json:

1.Turn off the wordWrap:

    "editor.wordWrap":"off",

2.Still keep wordWrap on but changing the code's max-length:

   "editor.wordWrap": "wordWrapColumn",
   "editor.wordWrapColumn":200,