]> git.eshelyaron.com Git - emacs.git/commitdiff
(move_it_to): When stopping at a charpos, check if that's a continued
authorChong Yidong <cyd@stupidchicken.com>
Fri, 8 Aug 2008 15:43:45 +0000 (15:43 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 8 Aug 2008 15:43:45 +0000 (15:43 +0000)
multi-char glyph; if so, advance to the actual glyph.

src/ChangeLog
src/xdisp.c

index 4544bf0b841b0c4dffab6ceb4c4a21c770bd9c1f..af871f2ce6276af5ae76b9db272a8617dccb6dd6 100644 (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
index 920e7c1d34e086a0a24259bdbc18e5c1294a5e4f..2f809e3a096753b4d4404464de5343bddf88cd18 100644 (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));
 }