How to set max line length in Android Studio code editor?

前端 未结 12 1097
温柔的废话
温柔的废话 2020-12-29 01:31

How can I set a maximum length for Android Studio\'s code editor, or may be set a word wrap?

In my Android Studio, no matter how long a statement I type on a single

相关标签:
12条回答
  • 2020-12-29 01:41

    You can change the Hard wrap at param

    0 讨论(0)
  • 2020-12-29 01:46

    You can change the max column width from: File > Settings > Editor > Code Style > Right Margin (columns)

    0 讨论(0)
  • 2020-12-29 01:51

    In File | Settings, select "Editor", then "Code Style". There is an option "Wrap when typing reaches right margin".

    Edit: Just tried it, and it doesn't seem to work. Anyway, maybe the option "Use soft wrap" in the "General" group is more what you want.

    0 讨论(0)
  • 2020-12-29 01:51

    MacOS:

    1. Click on Android Studio ( left top corner )
    2. Click Preferences
    3. Type Code Style in search
    4. Click on Code Style
    5. There is a filed right to the 'Hard wrap at' - you can enter needed about of symbols you need

    0 讨论(0)
  • 2020-12-29 01:52

    To move the grey vertical line, that tells Android Studio where to wrap your code, go to

    Settings- Editor- Code Style- Java or Kotlin- Wrapping and Braces- Hard wrap at

    and enter the number of characters, where the line should be.

    0 讨论(0)
  • 2020-12-29 01:53

    @Solace, actually @Fahim Faysal's answer is quite close to what you need, but since you want to solve the problem no matter how long a statement I type on a single line, it never automatically goes to the next line, 2 more steps you need to follow:
    [Step 9] type the max length you prefer at `"Hard wrap at" ()
    [Step 10] change "Wrap on typing" from Default: No or No to Yes

    0 讨论(0)
提交回复
热议问题