Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do my line numbers keep disappearing in Android Studio?

I want to display line numbers in my Android Studio editors.

I have turned line numbers ON in preferences

Preferences > Editor > Appearance

However, line numbers do not appear.

If I drop down the View menu and look at the Show Line Numbers option, it is NOT checked.

View > Active Editor > Show Line Numbers

If I check it, line numbers show. However, if I move my cursor to a different character or line, they immediately disappear.

Why is this happening?

like image 778
Andrew Avatar asked Apr 16 '15 20:04

Andrew


People also ask

How do I turn on line numbers in Android Studio?

How To Show line numbers In Android Studio. File > Settings > Editor > Appearance then click the "Show line numbers" box. Save this answer.


2 Answers

as @pgoggijr said already, this is a problem I was having with IDEAVim as well. however, you don't have to turn vim off. Just use the vim commands

:set nu

and

:set nonu

to toggle line numbers on and off, and these stay :)


Disclaimer: I wrote that doc

like image 92
Jeeter Avatar answered Oct 07 '22 15:10

Jeeter


I'm assuming that you're using the ideaVim emulator.

There seems to be a bug in the ideaVim plugin that has surfaced in recent versions of Android Studio that makes line numbers disappear once the cursor moves

Turn off the emulator (tools > VIM emulator), and it should be fine.

like image 37
pgoggijr Avatar answered Oct 07 '22 16:10

pgoggijr