changeset 59722:4712d3f43248

*** empty log message ***
author Kim F. Storm <storm@cua.dk>
date Mon, 24 Jan 2005 20:44:39 +0000
parents 0db7d5d8574b
children 08c7f3c89c0b befae6bafecb
files src/ChangeLog src/xdisp.c
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jan 24 18:23:33 2005 +0000
+++ b/src/ChangeLog	Mon Jan 24 20:44:39 2005 +0000
@@ -1,8 +1,13 @@
+2005-01-24  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (move_it_by_lines): If we move forward after going too
+	far back, cancel move if end position is same as start position.
+
 2005-01-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* dispextern.h (struct glyph_string): New members clip_head and
 	clip_tail.
-	
+
 	* xdisp.c (get_glyph_string_clip_rect): Restrict horizontal clip
 	region to the area between clip_head and clip_tail.
 	(draw_glyphs): Record the area that need to be actually redrawn to
@@ -10,17 +15,15 @@
 	overhangs.  Set values of these variables to the corresponding
 	members in struct glyph_string.  Refine x coordinates for
 	notice_overwritten_cursor using clip_head and clip_tail.
-	
+
 	* macgui.h (STORE_XCHARSETSTRUCT): New macro.
 
 	* macterm.c (mac_compute_glyph_string_overhangs): Implement with
 	QDTextBounds.
 	(x_draw_glyph_string): Don't fill the background of the successor
-	of a glyph with a right overhang if the successor will draw a
-	cursor.
+	of a glyph with a right overhang if the successor will draw a cursor.
 	(XLoadQueryFont): Obtain font metrics using QDTextBounds.
-	(x_redisplay_interface): Add entry for
-	compute_glyph_string_overhangs.
+	(x_redisplay_interface): Add entry for compute_glyph_string_overhangs.
 
 2005-01-24  Kim F. Storm  <storm@cua.dk>
 
--- a/src/xdisp.c	Mon Jan 24 18:23:33 2005 +0000
+++ b/src/xdisp.c	Mon Jan 24 20:44:39 2005 +0000
@@ -6413,11 +6413,15 @@
       it->current_y -= it2.current_y;
       it->current_x = it->hpos = 0;
 
-      /* If we moved too far, move IT some lines forward.  */
+      /* If we moved too far back, move IT some lines forward.  */
       if (it2.vpos > -dvpos)
 	{
 	  int delta = it2.vpos + dvpos;
+	  it2 = *it;
 	  move_it_to (it, -1, -1, -1, it->vpos + delta, MOVE_TO_VPOS);
+	  /* Move back again if we got too far ahead.  */
+	  if (IT_CHARPOS (*it) >= start_charpos)
+	    *it = it2;
 	}
     }
 }