changeset 104014:835416032efa

* xdisp.c (move_it_to): For continued lines ending in a tab, take the overflowed pixels into account (Bug#3879).
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 21 Jul 2009 20:12:09 +0000
parents 3c88eee19782
children 65ac865116fc
files src/ChangeLog src/xdisp.c
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Jul 21 19:01:41 2009 +0000
+++ b/src/ChangeLog	Tue Jul 21 20:12:09 2009 +0000
@@ -1,3 +1,8 @@
+2009-07-21  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xdisp.c (move_it_to): For continued lines ending in a tab, take
+	the overflowed pixels into account (Bug#3879).
+
 2009-07-21  Ken Raeburn  <raeburn@raeburn.org>
 
 	* lread.c (load_depth): New variable.
--- a/src/xdisp.c	Tue Jul 21 19:01:41 2009 +0000
+++ b/src/xdisp.c	Tue Jul 21 20:12:09 2009 +0000
@@ -7090,8 +7090,7 @@
      int op;
 {
   enum move_it_result skip, skip2 = MOVE_X_REACHED;
-  int line_height;
-  int reached = 0;
+  int line_height, line_start_x = 0, reached = 0;
 
   for (;;)
     {
@@ -7274,7 +7273,11 @@
 	      if (it->current_x != it->last_visible_x
 		  && (op & MOVE_TO_VPOS)
 	      	  && !(op & (MOVE_TO_X | MOVE_TO_POS)))
-	      	set_iterator_to_next (it, 0);
+		{
+		  line_start_x = it->current_x + it->pixel_width
+		    - it->last_visible_x;
+		  set_iterator_to_next (it, 0);
+		}
 	    }
 	  else
 	    it->continuation_lines_width += it->current_x;
@@ -7286,7 +7289,9 @@
 
       /* Reset/increment for the next run.  */
       recenter_overlay_lists (current_buffer, IT_CHARPOS (*it));
-      it->current_x = it->hpos = 0;
+      it->current_x = line_start_x;
+      line_start_x = 0;
+      it->hpos = 0;
       it->current_y += it->max_ascent + it->max_descent;
       ++it->vpos;
       last_height = it->max_ascent + it->max_descent;