aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-06-21 15:30:02 +0300
committerEli Zaretskii2014-06-21 15:30:02 +0300
commit53b15fa6dc1b975a617923ec1da5d1b29a1f6955 (patch)
tree06c89292e6bfa367849ae67b7fd86e6f017fa2f0 /src
parent3114d9e702aada713f029cfd80f8785240c9d940 (diff)
downloademacs-53b15fa6dc1b975a617923ec1da5d1b29a1f6955.tar.gz
emacs-53b15fa6dc1b975a617923ec1da5d1b29a1f6955.zip
Fix bug #17823 with vertical-motion in lines with line-prefix.
src/indent.c (Fvertical_motion): Move to the goal column, if any, with a single call to move_it_in_display_line, not in two calls. Doing this with two calls causes move_it_in_display_line apply the line-prefix handling twice instead of just once.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/indent.c18
2 files changed, 10 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 93a25ba2871..cd82e91c2dd 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,10 @@
12014-06-21 Eli Zaretskii <eliz@gnu.org> 12014-06-21 Eli Zaretskii <eliz@gnu.org>
2 2
3 * indent.c (Fvertical_motion): Doc fix. 3 * indent.c (Fvertical_motion): Doc fix.
4 Move to the goal column, if any, with a single call to
5 move_it_in_display_line, not in two calls. Doing this with two
6 calls causes move_it_in_display_line apply the line-prefix
7 handling twice instead of just once. (Bug#17823)
4 8
52014-06-21 Paul Eggert <eggert@cs.ucla.edu> 92014-06-21 Paul Eggert <eggert@cs.ucla.edu>
6 10
diff --git a/src/indent.c b/src/indent.c
index f492461bf50..711792f75cd 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2129,20 +2129,14 @@ whether or not it is currently displayed in some window. */)
2129 } 2129 }
2130 } 2130 }
2131 2131
2132 /* Move to the goal column, if one was specified. */ 2132 /* Move to the goal column, if one was specified. If the window
2133 was originally hscrolled, the goal column is interpreted as
2134 an addition to the hscroll amount. */
2133 if (!NILP (lcols)) 2135 if (!NILP (lcols))
2134 { 2136 {
2135 /* If the window was originally hscrolled, move forward by 2137 int to_x = (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5);
2136 the hscrolled amount first. */ 2138
2137 if (first_x > 0) 2139 move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
2138 {
2139 move_it_in_display_line (&it, ZV, first_x, MOVE_TO_X);
2140 it.current_x = 0;
2141 }
2142 move_it_in_display_line
2143 (&it, ZV,
2144 (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
2145 MOVE_TO_X);
2146 } 2140 }
2147 2141
2148 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 2142 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));