comparison src/dispnew.c @ 40075:c1d88076fa85

(update_frame_line): Don't call reassert_line_highlight. (line_hash_code, row_equal_p, fake_current_matrices) (build_frame_matrix_from_leaf_window, update_frame_line) (update_frame_line, update_frame_line, update_frame_line): Don't use `inverse_p' field.
author Miles Bader <miles@gnu.org>
date Sat, 20 Oct 2001 05:42:06 +0000
parents eac4e9ae201c
children a87bf217f5a6
comparison
equal deleted inserted replaced
40074:0d68fc35e9ad 40075:c1d88076fa85
1383 { 1383 {
1384 int hash = 0; 1384 int hash = 0;
1385 1385
1386 if (row->enabled_p) 1386 if (row->enabled_p)
1387 { 1387 {
1388 if (row->inverse_p) 1388 struct glyph *glyph = row->glyphs[TEXT_AREA];
1389 { 1389 struct glyph *end = glyph + row->used[TEXT_AREA];
1390 /* Give all highlighted lines the same hash code 1390
1391 so as to encourage scrolling to leave them in place. */ 1391 while (glyph < end)
1392 hash = -1; 1392 {
1393 } 1393 int c = glyph->u.ch;
1394 else 1394 int face_id = glyph->face_id;
1395 { 1395 if (must_write_spaces)
1396 struct glyph *glyph = row->glyphs[TEXT_AREA]; 1396 c -= SPACEGLYPH;
1397 struct glyph *end = glyph + row->used[TEXT_AREA]; 1397 hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c;
1398 1398 hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id;
1399 while (glyph < end) 1399 ++glyph;
1400 { 1400 }
1401 int c = glyph->u.ch; 1401
1402 int face_id = glyph->face_id; 1402 if (hash == 0)
1403 if (must_write_spaces) 1403 hash = 1;
1404 c -= SPACEGLYPH;
1405 hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c;
1406 hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id;
1407 ++glyph;
1408 }
1409
1410 if (hash == 0)
1411 hash = 1;
1412 }
1413 } 1404 }
1414 1405
1415 return hash; 1406 return hash;
1416 } 1407 }
1417 1408
1516 if (a_glyph != a_end) 1507 if (a_glyph != a_end)
1517 return 0; 1508 return 0;
1518 } 1509 }
1519 1510
1520 if (a->truncated_on_left_p != b->truncated_on_left_p 1511 if (a->truncated_on_left_p != b->truncated_on_left_p
1521 || a->inverse_p != b->inverse_p
1522 || a->fill_line_p != b->fill_line_p 1512 || a->fill_line_p != b->fill_line_p
1523 || a->truncated_on_right_p != b->truncated_on_right_p 1513 || a->truncated_on_right_p != b->truncated_on_right_p
1524 || a->overlay_arrow_p != b->overlay_arrow_p 1514 || a->overlay_arrow_p != b->overlay_arrow_p
1525 || a->continued_p != b->continued_p 1515 || a->continued_p != b->continued_p
1526 || a->indicate_empty_line_p != b->indicate_empty_line_p 1516 || a->indicate_empty_line_p != b->indicate_empty_line_p
2188 r->used[RIGHT_MARGIN_AREA] = m->right_margin_glyphs; 2178 r->used[RIGHT_MARGIN_AREA] = m->right_margin_glyphs;
2189 r->used[TEXT_AREA] = (m->matrix_w 2179 r->used[TEXT_AREA] = (m->matrix_w
2190 - r->used[LEFT_MARGIN_AREA] 2180 - r->used[LEFT_MARGIN_AREA]
2191 - r->used[RIGHT_MARGIN_AREA]); 2181 - r->used[RIGHT_MARGIN_AREA]);
2192 r->mode_line_p = 0; 2182 r->mode_line_p = 0;
2193 r->inverse_p = fr->inverse_p;
2194 } 2183 }
2195 } 2184 }
2196 } 2185 }
2197 } 2186 }
2198 } 2187 }
2795 /* Set number of used glyphs in the frame matrix. Since we fill 2784 /* Set number of used glyphs in the frame matrix. Since we fill
2796 up with spaces, and visit leaf windows from left to right it 2785 up with spaces, and visit leaf windows from left to right it
2797 can be done simply. */ 2786 can be done simply. */
2798 frame_row->used[TEXT_AREA] 2787 frame_row->used[TEXT_AREA]
2799 = window_matrix->matrix_x + window_matrix->matrix_w; 2788 = window_matrix->matrix_x + window_matrix->matrix_w;
2800
2801 /* Or in other flags. */
2802 frame_row->inverse_p |= window_row->inverse_p;
2803 2789
2804 /* Next row. */ 2790 /* Next row. */
2805 ++window_y; 2791 ++window_y;
2806 ++frame_y; 2792 ++frame_y;
2807 } 2793 }
5397 != FACE_TTY_DEFAULT_BG_COLOR); 5383 != FACE_TTY_DEFAULT_BG_COLOR);
5398 5384
5399 if (colored_spaces_p) 5385 if (colored_spaces_p)
5400 write_spaces_p = 1; 5386 write_spaces_p = 1;
5401 5387
5402 if (desired_row->inverse_p
5403 != (current_row->enabled_p && current_row->inverse_p))
5404 {
5405 int n = current_row->enabled_p ? current_row->used[TEXT_AREA] : 0;
5406 change_line_highlight (desired_row->inverse_p, vpos, vpos, n);
5407 current_row->enabled_p = 0;
5408 }
5409 else
5410 reassert_line_highlight (desired_row->inverse_p, vpos);
5411
5412 /* Current row not enabled means it has unknown contents. We must 5388 /* Current row not enabled means it has unknown contents. We must
5413 write the whole desired line in that case. */ 5389 write the whole desired line in that case. */
5414 must_write_whole_line_p = !current_row->enabled_p; 5390 must_write_whole_line_p = !current_row->enabled_p;
5415 if (must_write_whole_line_p) 5391 if (must_write_whole_line_p)
5416 { 5392 {
5420 else 5396 else
5421 { 5397 {
5422 obody = MATRIX_ROW_GLYPH_START (current_matrix, vpos); 5398 obody = MATRIX_ROW_GLYPH_START (current_matrix, vpos);
5423 olen = current_row->used[TEXT_AREA]; 5399 olen = current_row->used[TEXT_AREA];
5424 5400
5425 if (!current_row->inverse_p) 5401 /* Ignore trailing spaces, if we can. */
5426 { 5402 if (!write_spaces_p)
5427 /* Ignore trailing spaces, if we can. */ 5403 while (olen > 0 && CHAR_GLYPH_SPACE_P (obody[olen-1]))
5428 if (!write_spaces_p) 5404 olen--;
5429 while (olen > 0 && CHAR_GLYPH_SPACE_P (obody[olen-1]))
5430 olen--;
5431 }
5432 else
5433 {
5434 /* For an inverse-video line, make sure it's filled with
5435 spaces all the way to the frame edge so that the reverse
5436 video extends all the way across. */
5437 while (olen < FRAME_WIDTH (f) - 1)
5438 obody[olen++] = space_glyph;
5439 }
5440 } 5405 }
5441 5406
5442 current_row->enabled_p = 1; 5407 current_row->enabled_p = 1;
5443 current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA]; 5408 current_row->used[TEXT_AREA] = desired_row->used[TEXT_AREA];
5444 current_row->inverse_p = desired_row->inverse_p;
5445 5409
5446 /* If desired line is empty, just clear the line. */ 5410 /* If desired line is empty, just clear the line. */
5447 if (!desired_row->enabled_p) 5411 if (!desired_row->enabled_p)
5448 { 5412 {
5449 nlen = 0; 5413 nlen = 0;
5486 return; 5450 return;
5487 } 5451 }
5488 5452
5489 /* Pretend trailing spaces are not there at all, 5453 /* Pretend trailing spaces are not there at all,
5490 unless for one reason or another we must write all spaces. */ 5454 unless for one reason or another we must write all spaces. */
5491 if (!desired_row->inverse_p) 5455 if (!write_spaces_p)
5492 { 5456 while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1]))
5493 if (!write_spaces_p) 5457 nlen--;
5494 while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1]))
5495 nlen--;
5496 }
5497 else
5498 {
5499 /* For an inverse-video line, give it extra trailing spaces all
5500 the way to the frame edge so that the reverse video extends
5501 all the way across. */
5502 while (nlen < FRAME_WIDTH (f) - 1)
5503 nbody[nlen++] = space_glyph;
5504 }
5505 5458
5506 /* If there's no i/d char, quickly do the best we can without it. */ 5459 /* If there's no i/d char, quickly do the best we can without it. */
5507 if (!char_ins_del_ok) 5460 if (!char_ins_del_ok)
5508 { 5461 {
5509 int i, j; 5462 int i, j;
5548 5501
5549 if (!olen) 5502 if (!olen)
5550 { 5503 {
5551 /* If current line is blank, skip over initial spaces, if 5504 /* If current line is blank, skip over initial spaces, if
5552 possible, and write the rest. */ 5505 possible, and write the rest. */
5553 if (write_spaces_p || desired_row->inverse_p) 5506 if (write_spaces_p)
5554 nsp = 0; 5507 nsp = 0;
5555 else 5508 else
5556 nsp = count_blanks (nbody, nlen); 5509 nsp = count_blanks (nbody, nlen);
5557 5510
5558 if (nlen > nsp) 5511 if (nlen > nsp)
5566 return; 5519 return;
5567 } 5520 }
5568 5521
5569 /* Compute number of leading blanks in old and new contents. */ 5522 /* Compute number of leading blanks in old and new contents. */
5570 osp = count_blanks (obody, olen); 5523 osp = count_blanks (obody, olen);
5571 nsp = (desired_row->inverse_p || colored_spaces_p 5524 nsp = (colored_spaces_p ? 0 : count_blanks (nbody, nlen));
5572 ? 0
5573 : count_blanks (nbody, nlen));
5574 5525
5575 /* Compute number of matching chars starting with first non-blank. */ 5526 /* Compute number of matching chars starting with first non-blank. */
5576 begmatch = count_match (obody + osp, obody + olen, 5527 begmatch = count_match (obody + osp, obody + olen,
5577 nbody + nsp, nbody + nlen); 5528 nbody + nsp, nbody + nlen);
5578 5529