(move_it_to): When stopping at a charpos, check if that's a continued

multi-char glyph; if so, advance to the actual glyph.
This commit is contained in:
Chong Yidong 2008-08-08 15:43:45 +00:00
parent 96f55ac019
commit 97c9858753
2 changed files with 30 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2008-08-08 Chong Yidong <cyd@stupidchicken.com>
* xdisp.c (move_it_to): When stopping at a charpos, check if
that's a continued multi-char glyph; if so, advance to the actual
glyph.
2008-08-07 Dan Nicolaescu <dann@ics.uci.edu>
* s/darwin.h (OTHER_FILES): Do not define here, defined in

View file

@ -7296,6 +7296,30 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
out:
/* On text terminals, we may stop at the end of a line in the middle
of a multi-character glyph. If the glyph itself is continued,
i.e. it is actually displayed on the next line, don't treat this
stopping point as valid; move to the next line instead (unless
that brings us offscreen). */
if (!FRAME_WINDOW_P (it->f)
&& op & MOVE_TO_POS
&& IT_CHARPOS (*it) == to_charpos
&& it->what == IT_CHARACTER
&& it->nglyphs > 1
&& it->line_wrap == WINDOW_WRAP
&& it->current_x == it->last_visible_x - 1
&& it->c != '\n'
&& it->c != '\t'
&& it->vpos < XFASTINT (it->w->window_end_vpos))
{
it->continuation_lines_width += it->current_x;
it->current_x = it->hpos = it->max_ascent = it->max_descent = 0;
it->current_y += it->max_ascent + it->max_descent;
++it->vpos;
last_height = it->max_ascent + it->max_descent;
last_max_ascent = it->max_ascent;
}
TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached));
}