aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2014-07-08 18:12:39 +0300
committerEli Zaretskii2014-07-08 18:12:39 +0300
commit9aac592d887c360c9cae88db350ec69019ded573 (patch)
tree3bb2dfc765a308456b4bdfd3e4dd07f0d8492616
parent7acd41f38f21b03dd73256e7ef5a7db2c733df00 (diff)
downloademacs-9aac592d887c360c9cae88db350ec69019ded573.tar.gz
emacs-9aac592d887c360c9cae88db350ec69019ded573.zip
Fix bug #17969 with vertical-motion through continuation lines with TABs.
src/xdisp.c (move_it_to): Adjust calculation of line_start_x to what x_produce_glyphs does when it generates a stretch glyph that represents a TAB.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/xdisp.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 89621bd54ec..d2f1999b546 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-07-08 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (move_it_to): Adjust calculation of line_start_x to what
4 x_produce_glyphs does when it generates a stretch glyph that
5 represents a TAB. (Bug#17969)
6
12014-07-05 Eli Zaretskii <eliz@gnu.org> 72014-07-05 Eli Zaretskii <eliz@gnu.org>
2 8
3 * xdisp.c (pos_visible_p): If CHARPOS is at beginning of window, 9 * xdisp.c (pos_visible_p): If CHARPOS is at beginning of window,
diff --git a/src/xdisp.c b/src/xdisp.c
index 28752a42cb9..61d1fa24c68 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9250,6 +9250,25 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
9250 { 9250 {
9251 line_start_x = it->current_x + it->pixel_width 9251 line_start_x = it->current_x + it->pixel_width
9252 - it->last_visible_x; 9252 - it->last_visible_x;
9253 if (FRAME_WINDOW_P (it->f))
9254 {
9255 struct face *face = FACE_FROM_ID (it->f, it->face_id);
9256 struct font *face_font = face->font;
9257
9258 /* When display_line produces a continued line
9259 that ends in a TAB, it skips a tab stop that
9260 is closer than the font's space character
9261 width (see x_produce_glyphs where it produces
9262 the stretch glyph which represents a TAB).
9263 We need to reproduce the same logic here. */
9264 eassert (face_font);
9265 if (face_font)
9266 {
9267 if (line_start_x < face_font->space_width)
9268 line_start_x
9269 += it->tab_width * face_font->space_width;
9270 }
9271 }
9253 set_iterator_to_next (it, 0); 9272 set_iterator_to_next (it, 0);
9254 } 9273 }
9255 } 9274 }