#4808 Cursor in wrong place after Ctrl-End/Ctrl-Home on files longer than 998 lines

1.x
open
nobody
None
5
2014-05-08
2014-05-08
Dave
No

This is easy to reproduce.
Create a test file containing 4 lines:
abcde
fghij
klmno
~~

and repeat the last line until you have 999 or more lines, and so that the screen looks like this, including the line number display, and replacing spaces with underscores:
_997~~
_998
~~
_999__

This does not reproduce if there are 998 or fewer lines. Note that 999 needs to show in the line number column; it doesn't matter if there is anything in line 999. Also note that "Display line number" needs to be enabled.

Now go to the end with Ctrl-End, then home with Ctrl-Home, then cursor down. The cursor should be to the left of "f", but it is wrongly placed between "f" and "g". If you cursor down some more, the cursor stays at column 2 until you hit cursor left or Ctrl-Home again.

There is a similar bug after 9999 lines except after Ctrl-Home the cursor is now wrongly indented by two columns. At a guess there'll be another at 99999 lines and so on.

There is no bug at 99 lines, presumably because there is no change in the line number width.

Impact: minimal, I suppose. It's very annoying, because after Ctrl-Home I expect the cursor to be at the far left of the screen.

Discussion

  • Dave
    Dave
    2014-05-08

    Screenshot munged. Should have previewed - sorry. Checked the Markdown docs and it appears I have no way of describing exactly what I want to say, so spelling it out in English seems to be the only way. Tried indenting with 4 spaces and it still meta'd out the underscores.

    So I'll try spelling out the screenshot using English words instead:

    Space nine nine seven space space tilde tilde.
    Space nine nine eight space space tilde tilde.
    Space nine nine nine space space.

    Everything left of the tildes is the line number column therefore has a grey background.