summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2018-06-06 18:28:44 +0300
committerEli Zaretskii <eliz@gnu.org>2018-06-06 18:28:44 +0300
commite5ab25deaeb5daf58d2e3b0c990cd67e6020bb38 (patch)
tree581e449920bba48915918905bd040926868c65e1 /src/indent.c
parentd20beef5f104909f765430e347f5f3711ea51149 (diff)
downloademacs-e5ab25deaeb5daf58d2e3b0c990cd67e6020bb38.tar.gz
Fix cursor movement by 'next-logical-line' after 'next-line'
* src/indent.c (Fvertical_motion): Adjust TO_X when line-numbers are being displayed. Remove unneeded "correction" of TO_X at the goal line. * lisp/simple.el (last--line-number-width): Remove unneeded variable. (line-move-visual): Account for line-number display width by adjusting the pixel X coordinate that gets converted into canonical columns passed to vertical-motion, instead of adjusting temporary-goal-column (which then affects next commands, including next-logical-line). (Bug#31723)
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/indent.c b/src/indent.c
index 316171e609b..bcffa0d11e5 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2278,7 +2278,9 @@ whether or not it is currently displayed in some window. */)
overshoot_handled = 1;
}
if (lcols_given)
- to_x = window_column_x (w, window, extract_float (lcols), lcols);
+ to_x =
+ window_column_x (w, window, extract_float (lcols), lcols)
+ + lnum_pixel_width;
if (nlines <= 0)
{
it.vpos = vpos_init;
@@ -2330,12 +2332,6 @@ whether or not it is currently displayed in some window. */)
an addition to the hscroll amount. */
if (lcols_given)
{
- /* If we are displaying line numbers, we could cross the
- line where the width of the line-number display changes,
- in which case we need to fix up the pixel coordinate
- accordingly. */
- if (lnum_pixel_width > 0)
- to_x += it.lnum_pixel_width - lnum_pixel_width;
move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
/* If we find ourselves in the middle of an overlay string
which includes a newline after current string position,