5

When I enable line numbers in Emacs the cursor starts in a line with no number in it. If you press enter then the numbers increment but always there is a line with no number. Why is that happening?

enter image description here

enter image description here

Malabarba
  • 22,878
  • 6
  • 78
  • 163
Adam
  • 2,407
  • 2
  • 21
  • 38

1 Answers1

5

Because the last line hasn't started yet. Adding newline symbol to the end makes the cursor jump from the current line to the next one, but it doesn't add anything to it (new one). Strictly speaking, it is not a line yet.

Supposing that every newline symbol was visible, you would get

1. <newline_symbol>
2. <newline_symbol>
3. <newline_symbol>
   <cursor_there_and_nothing_else>

Once you start typing in this line, it receives some content, so the number will appear.

nicael
  • 1,598
  • 2
  • 13
  • 20