# HG changeset patch # User Kim F. Storm # Date 1099951933 0 # Node ID b9f91c49472283e799ae8fa6087037a73cc5a8f2 # Parent 5ae6aa640a4722fc7fb639a07af705624fc93472 (fast_find_position): Fix start pos if header line present. diff -r 5ae6aa640a47 -r b9f91c494722 src/xdisp.c --- a/src/xdisp.c Mon Nov 08 22:11:40 2004 +0000 +++ b/src/xdisp.c Mon Nov 08 22:12:13 2004 +0000 @@ -20411,19 +20411,20 @@ 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;