Search code examples
androidandroid-studioformattingword-wrapandroid-studio-3.0

Is there a way to wrap code neatly in Android Studio?


I've enabled word wrap in the editor, but it doesn't align to the relevant scope, which looks unnecessarily messy.

Here is an example of the automatic behavior: word-wrap-default

enter image description here

Here is an example of what I'd like the automatic behavior to be: word-wrap-preferred

enter image description here

Is there a way to set this up in Android Studio 3.0?


Solution

  • In Android Studio 3.0 following should help:

    File > Settings > Editor > General > Soft Wraps > & checking "Use original lines indent for wrapped parts"

    enter image description here