From 72589a3ceebd3b6c903963e5f82b78df004e851d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Johan=20Bockg=C3=A5rd?= Date: Thu, 15 Sep 2011 19:02:49 +0300 Subject: [PATCH] =?utf8?q?Fix=20bug=20#9495=20with=20cursor=20positioning?= =?utf8?q?=20on=20truncated=20lines.=20Patch=20by=20Johan=20Bockg=D7=95rd?= =?utf8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit src/xdisp.c (try_cursor_movement): Only check for exact match if cursor hpos found by set_cursor_from_row is valid. (Bug#9495) --- src/ChangeLog | 5 +++++ src/xdisp.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3dbddc9b215..83dc66a1720 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-09-15 Johan Bockgård + + * xdisp.c (try_cursor_movement): Only check for exact match if + cursor hpos found by set_cursor_from_row is valid. (Bug#9495) + 2011-09-14 Paul Eggert Remove unused external symbols. diff --git a/src/xdisp.c b/src/xdisp.c index 1ccaa0641b0..0f842b8673e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -14627,7 +14627,10 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste is set, we are done. */ at_zv_p = MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p; - if (!at_zv_p) + if (rv && !at_zv_p + && w->cursor.hpos >= 0 + && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix, + w->cursor.vpos)) { struct glyph_row *candidate = MATRIX_ROW (w->current_matrix, w->cursor.vpos); -- 2.39.2