summaryrefslogtreecommitdiff
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2009-07-21 20:12:09 +0000
committerChong Yidong <cyd@stupidchicken.com>2009-07-21 20:12:09 +0000
commite6583e3d76a55dac04206a9296a80cb837ec709e (patch)
tree459713a61024e3b96fd007348909ffb7c9a60bb4 /src/xdisp.c
parentec06459cb6f90d7d8cf05d48cb66ac4cd0d85aad (diff)
downloademacs-e6583e3d76a55dac04206a9296a80cb837ec709e.tar.gz
* xdisp.c (move_it_to): For continued lines ending in a tab, take
the overflowed pixels into account (Bug#3879).
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index a0ac755ffa6..33cd722e6b4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7090,8 +7090,7 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
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 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
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 @@ move_it_to (it, to_charpos, to_x, to_y, to_vpos, op)
/* 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;