diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-07-21 20:08:49 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-07-21 20:08:49 +0000 |
commit | c48cbceb0ba8c4726787206b93a76bed5d3343a3 (patch) | |
tree | 46863300add6d5546113d61c02d66ec0886c19aa | |
parent | 52cc7b91d26e163580b75c3a6d1dbc8ead6a3038 (diff) | |
download | emacs-c48cbceb0ba8c4726787206b93a76bed5d3343a3.tar.gz |
* xdisp.c (move_it_to): For continued lines ending in a tab, take
the overflowed pixels into account (Bug#3879).
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/xdisp.c | 13 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index debe74f2bdb..1ed4b48e3ca 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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-17 Kenichi Handa <handa@m17n.org> * casetab.c (shuffle): Fix the logic of setting up the cycle. diff --git a/src/xdisp.c b/src/xdisp.c index 8a2b2a387d9..f37586e81dc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7108,8 +7108,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 (;;) { @@ -7292,7 +7291,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; @@ -7304,7 +7307,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; |