Vertical Line in Android Studio

Android StudioEditorCode Editor

Android Studio Problem Overview


I don't know why but sometime in Android Studio Editor, it shows vertical line as shown in screenshot below.

Don't know about other editor but it happens in Android Studio.

> So why it is showing and how to hide it?

Android Studio shows Vertical Line in Editor

Android Studio Solutions


Solution 1 - Android Studio

That line historically represents the margin of A4 paper, which is useful only if you need to print the code. Old school says that you should keep your code inside that margin, to guarantee much portability.

But.. nowadays in the real life, it makes no sense to me! Because we always use advanced editors, bigger displays, and I never needed to print any single line of code.

So, if you want to do it:

Newer versions

> Editor -> General -> Appearance -> Show hard wrap guide

Older versions

> Editor -> General -> Appearance -> Show right margin

or

> Editor -> Appearance -> Show right margin

For Mac

>To remove line go to:- Preference-> Editor -> General -> Appearance -> Show hard wrap and visual guides. Uncheck it to remove.

Solution 2 - Android Studio

It is as follows in the newer version of Android Studio:

Editor -> General -> Appearance -> Show hard wrap guide

Solution 3 - Android Studio

Android Studio has changed layout again, so you can find this option at:

File -> Settings -> Editor -> General -> Appearance -> Show hard wrap and visual guides

As it is mentioned earlier, if your code is of that length, it is pretty obvious that it is not that readable, i.e. clean. Being old school, I keep it at 80 characters and spill occasionally.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJagruttam PanchalView Question on Stackoverflow
Solution 1 - Android StudioLuca CorradiView Answer on Stackoverflow
Solution 2 - Android StudiotheThapaView Answer on Stackoverflow
Solution 3 - Android StudioViktor BrešanView Answer on Stackoverflow