Subject: Line number shifts left when horizontal scrolling with a tab.

From: Keith David Bershatsky <[email-masked]>
Date: Thu, 22 Feb 2018 12:51:29 -0800

Step 1:  Launch Emacs 26

Step 2:  Switch to the *scratch* buffer.  We should be on line 4, with the default scratch message on the first 2 lines above.

Step 3:  M-x display-line-numbers-mode

Step 4:  Type:  C-q TAB Hello-world.

Step 5:  Evaluate:  (scroll-left 5)

Observe that the line number of the current line shifts to the left such that it is no longer aligned with the other line numbers.  The same will hold true under a variety of similar circumstances; e.g., line numbers exist below the current line; more than 10 lines exist, etc.

Related issue:  I am still working on debugging a few semi-related issues involving move_it_in_display_line_to in conjunction with bug #30226, and I see the need to either fix the problem described above; or, create a programmatic workaround when calculating X and HPOS along on the current line whenever line numbers shift to the left.  If the problem described above is fixed, then no programmatic workaround would be needed.

Thanks,

Keith