You can use auto-formatting by running the Reformat code function
(CTRL+ALT+L) after few changes in Code Style settings.
(alternatively Reformat code, ⌥+⌘+L on MacOS),
- Press CTRL+ALT+S to open
Settingswindow (orPreferences, ⌘+, on MacOS) - Go to
Code Stylemenu, and chooseJavasubmenu - Go to
Wrapping and Bracestab - Make sure to uncheck
Line Breaksoption and checkEnsure right margin is not exceededoption - Press
OKto accept changes you’ve made
Now when using auto-formatting (CTRL+ALT+L / MacOS ⌥+⌘+L) long strings exceeding line character limit will be automatically cut into multiple lines.