aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2008-07-12 03:19:38 +0000
committerChong Yidong2008-07-12 03:19:38 +0000
commit2f4ec7ce4fe0cb5036a919abdc101a611202ffd2 (patch)
treeeb9cf2b4a8de2355c770538c1facd94207d51bc7 /src
parente433031a1afbb91cf0404a39ea4daa672a618b08 (diff)
downloademacs-2f4ec7ce4fe0cb5036a919abdc101a611202ffd2.tar.gz
emacs-2f4ec7ce4fe0cb5036a919abdc101a611202ffd2.zip
(Fvertical_motion): Restore hscroll before moving to goal column.
Diffstat (limited to 'src')
-rw-r--r--src/indent.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/indent.c b/src/indent.c
index be5dc5f667f..d556cd87748 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2055,12 +2055,11 @@ whether or not it is currently displayed in some window. */)
2055 } 2055 }
2056 else 2056 else
2057 { 2057 {
2058 int it_start; 2058 int it_start, oselective, it_overshoot_expected, first_x;
2059 int oselective;
2060 int it_overshoot_expected;
2061 2059
2062 SET_TEXT_POS (pt, PT, PT_BYTE); 2060 SET_TEXT_POS (pt, PT, PT_BYTE);
2063 start_display (&it, w, pt); 2061 start_display (&it, w, pt);
2062 first_x = it.first_visible_x;
2064 2063
2065 /* Scan from the start of the line containing PT. If we don't 2064 /* Scan from the start of the line containing PT. If we don't
2066 do this, we start moving with IT->current_x == 0, while PT is 2065 do this, we start moving with IT->current_x == 0, while PT is
@@ -2118,11 +2117,21 @@ whether or not it is currently displayed in some window. */)
2118 if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0) 2117 if (XINT (lines) >= 0 || IT_CHARPOS (it) > 0)
2119 move_it_by_lines (&it, XINT (lines), 0); 2118 move_it_by_lines (&it, XINT (lines), 0);
2120 2119
2120 /* Move to the goal column, if one was specified. */
2121 if (!NILP (lcols)) 2121 if (!NILP (lcols))
2122 move_it_in_display_line 2122 {
2123 (&it, ZV, 2123 /* If the window was originally hscrolled, move forward by
2124 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5), 2124 the hscrolled amount first. */
2125 MOVE_TO_X); 2125 if (first_x > 0)
2126 {
2127 move_it_in_display_line (&it, ZV, first_x, MOVE_TO_X);
2128 it.current_x = 0;
2129 }
2130 move_it_in_display_line
2131 (&it, ZV,
2132 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
2133 MOVE_TO_X);
2134 }
2126 2135
2127 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2136 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
2128 } 2137 }