From a78bc3c08a389b62d24b95a2d93b69905b2ff824 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 8 Nov 2004 22:12:13 +0000 Subject: [PATCH] (fast_find_position): Fix start pos if header line present. --- src/xdisp.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 2ed455e7f6b..b934e706c59 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20411,19 +20411,20 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop) int past_end = 0; first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); + if (charpos < MATRIX_ROW_START_CHARPOS (first)) + { + *x = first->x; + *y = first->y; + *hpos = 0; + *vpos = MATRIX_ROW_VPOS (first, w->current_matrix); + return 1; + } + row = row_containing_pos (w, charpos, first, NULL, 0); if (row == NULL) { - if (charpos < MATRIX_ROW_START_CHARPOS (first)) - { - *x = *y = *hpos = *vpos = 0; - return 1; - } - else - { - row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); - past_end = 1; - } + row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + past_end = 1; } *x = row->x; -- 2.39.5