summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2008-08-08 15:50:53 +0000
committerChong Yidong <cyd@stupidchicken.com>2008-08-08 15:50:53 +0000
commit5c9c741451ca3664375b2c427370d2905f00f5c5 (patch)
tree83a4735d8fdaeba8e92f9d4b836aa95f35755151
parent9732330d81b0510ecb1269c6ab393a39e111d531 (diff)
downloademacs-5c9c741451ca3664375b2c427370d2905f00f5c5.tar.gz
(move_it_to): When stopping at a charpos, check if that's a continued
multi-char glyph; if so, advance to the actual glyph. (try_window): Check scroll margin on bottom window edge too.
-rw-r--r--src/xdisp.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 46217731fa1..6eca10a10e7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6932,6 +6932,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));
}
@@ -13665,7 +13689,7 @@ try_window (window, pos, check_margins)
seems to give wrong results. We don't want to recenter
when the last line is partly visible, we want to allow
that case to be handled in the usual way. */
- || (w->cursor.y + 1) > it.last_visible_y)
+ || w->cursor.y > it.last_visible_y - this_scroll_margin - 1)
{
w->cursor.vpos = -1;
clear_glyph_matrix (w->desired_matrix);