Mercurial > emacs
comparison src/xdisp.c @ 37681:f62a33411ad8
(try_window_id): Fix computation of window end in
the case that lines were deleted at the end of the window.
Add some more debug_method_adds.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 11 May 2001 12:57:00 +0000 |
parents | b88adb23e3e1 |
children | 2a1bebae1d80 |
comparison
equal
deleted
inserted
replaced
37680:2947eb80d57c | 37681:f62a33411ad8 |
---|---|
11654 w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); | 11654 w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); |
11655 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); | 11655 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); |
11656 w->window_end_vpos | 11656 w->window_end_vpos |
11657 = make_number (MATRIX_ROW_VPOS (row, w->current_matrix)); | 11657 = make_number (MATRIX_ROW_VPOS (row, w->current_matrix)); |
11658 xassert (w->window_end_bytepos >= 0); | 11658 xassert (w->window_end_bytepos >= 0); |
11659 IF_DEBUG (debug_method_add (w, "A")); | |
11659 } | 11660 } |
11660 else if (last_text_row_at_end) | 11661 else if (last_text_row_at_end) |
11661 { | 11662 { |
11662 w->window_end_pos | 11663 w->window_end_pos |
11663 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)); | 11664 = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row_at_end)); |
11664 w->window_end_bytepos | 11665 w->window_end_bytepos |
11665 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); | 11666 = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); |
11666 w->window_end_vpos | 11667 w->window_end_vpos |
11667 = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)); | 11668 = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)); |
11668 xassert (w->window_end_bytepos >= 0); | 11669 xassert (w->window_end_bytepos >= 0); |
11670 IF_DEBUG (debug_method_add (w, "B")); | |
11669 } | 11671 } |
11670 else if (last_text_row) | 11672 else if (last_text_row) |
11671 { | 11673 { |
11672 /* We have displayed either to the end of the window or at the | 11674 /* We have displayed either to the end of the window or at the |
11673 end of the window, i.e. the last row with text is to be found | 11675 end of the window, i.e. the last row with text is to be found |
11684 && last_text_row == NULL | 11686 && last_text_row == NULL |
11685 && last_text_row_at_end == NULL) | 11687 && last_text_row_at_end == NULL) |
11686 { | 11688 { |
11687 /* Displayed to end of window, but no line containing text was | 11689 /* Displayed to end of window, but no line containing text was |
11688 displayed. Lines were deleted at the end of the window. */ | 11690 displayed. Lines were deleted at the end of the window. */ |
11689 int vpos; | 11691 int first_vpos = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; |
11690 int header_line_p = WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0; | 11692 int vpos = XFASTINT (w->window_end_vpos); |
11691 | 11693 struct glyph_row *current_row = current_matrix->rows + vpos; |
11692 for (vpos = XFASTINT (w->window_end_vpos); vpos > 0; --vpos) | 11694 struct glyph_row *desired_row = desired_matrix->rows + vpos; |
11693 if ((w->desired_matrix->rows[vpos + header_line_p].enabled_p | 11695 |
11694 && w->desired_matrix->rows[vpos + header_line_p].displays_text_p) | 11696 for (row = NULL; |
11695 || (!w->desired_matrix->rows[vpos + header_line_p].enabled_p | 11697 row == NULL && vpos >= first_vpos; |
11696 && w->current_matrix->rows[vpos + header_line_p].displays_text_p)) | 11698 --vpos, --current_row, --desired_row) |
11697 break; | 11699 { |
11698 | 11700 if (desired_row->enabled_p) |
11701 { | |
11702 if (desired_row->displays_text_p) | |
11703 row = desired_row; | |
11704 } | |
11705 else if (current_row->displays_text_p) | |
11706 row = current_row; | |
11707 } | |
11708 | |
11709 xassert (row != NULL); | |
11699 w->window_end_vpos = make_number (vpos); | 11710 w->window_end_vpos = make_number (vpos); |
11700 row = MATRIX_ROW (w->desired_matrix, vpos); | |
11701 w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); | 11711 w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); |
11702 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); | 11712 w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); |
11703 xassert (w->window_end_bytepos >= 0); | 11713 xassert (w->window_end_bytepos >= 0); |
11714 IF_DEBUG (debug_method_add (w, "C")); | |
11704 } | 11715 } |
11705 else | 11716 else |
11706 abort (); | 11717 abort (); |
11707 | 11718 |
11708 #if 0 /* This leads to problems, for instance when the cursor is | 11719 #if 0 /* This leads to problems, for instance when the cursor is |