aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2008-08-08 15:50:53 +0000
committerChong Yidong2008-08-08 15:50:53 +0000
commit5c9c741451ca3664375b2c427370d2905f00f5c5 (patch)
tree83a4735d8fdaeba8e92f9d4b836aa95f35755151 /src
parent9732330d81b0510ecb1269c6ab393a39e111d531 (diff)
downloademacs-5c9c741451ca3664375b2c427370d2905f00f5c5.tar.gz
emacs-5c9c741451ca3664375b2c427370d2905f00f5c5.zip
(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.
Diffstat (limited to 'src')
-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)
6932 6932
6933 out: 6933 out:
6934 6934
6935 /* On text terminals, we may stop at the end of a line in the middle
6936 of a multi-character glyph. If the glyph itself is continued,
6937 i.e. it is actually displayed on the next line, don't treat this
6938 stopping point as valid; move to the next line instead (unless
6939 that brings us offscreen). */
6940 if (!FRAME_WINDOW_P (it->f)
6941 && op & MOVE_TO_POS
6942 && IT_CHARPOS (*it) == to_charpos
6943 && it->what == IT_CHARACTER
6944 && it->nglyphs > 1
6945 && it->line_wrap == WINDOW_WRAP
6946 && it->current_x == it->last_visible_x - 1
6947 && it->c != '\n'
6948 && it->c != '\t'
6949 && it->vpos < XFASTINT (it->w->window_end_vpos))
6950 {
6951 it->continuation_lines_width += it->current_x;
6952 it->current_x = it->hpos = it->max_ascent = it->max_descent = 0;
6953 it->current_y += it->max_ascent + it->max_descent;
6954 ++it->vpos;
6955 last_height = it->max_ascent + it->max_descent;
6956 last_max_ascent = it->max_ascent;
6957 }
6958
6935 TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached)); 6959 TRACE_MOVE ((stderr, "move_it_to: reached %d\n", reached));
6936} 6960}
6937 6961
@@ -13665,7 +13689,7 @@ try_window (window, pos, check_margins)
13665 seems to give wrong results. We don't want to recenter 13689 seems to give wrong results. We don't want to recenter
13666 when the last line is partly visible, we want to allow 13690 when the last line is partly visible, we want to allow
13667 that case to be handled in the usual way. */ 13691 that case to be handled in the usual way. */
13668 || (w->cursor.y + 1) > it.last_visible_y) 13692 || w->cursor.y > it.last_visible_y - this_scroll_margin - 1)
13669 { 13693 {
13670 w->cursor.vpos = -1; 13694 w->cursor.vpos = -1;
13671 clear_glyph_matrix (w->desired_matrix); 13695 clear_glyph_matrix (w->desired_matrix);