static void clear_window_matrices P_ ((struct window *, int));
static void fill_up_glyph_row_area_with_spaces P_ ((struct glyph_row *, int));
static int scrolling_window P_ ((struct window *, int));
-static int update_window_line P_ ((struct window *, int));
+static int update_window_line P_ ((struct window *, int, int *));
static void update_marginal_area P_ ((struct window *, int, int));
static int update_text_area P_ ((struct window *, int));
static void make_current P_ ((struct glyph_matrix *, struct glyph_matrix *,
{
struct glyph_row *current_row = MATRIX_ROW (current_matrix, row);
struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, row);
+ int mouse_face_p = current_row->mouse_face_p;
/* Do current_row = desired_row. This exchanges glyph pointers
between both rows, and does a structure assignment otherwise. */
/* Enable current_row to mark it as valid. */
current_row->enabled_p = 1;
+ current_row->mouse_face_p = mouse_face_p;
/* If we are called on frame matrices, perform analogous operations
for window matrices. */
int added_width;
struct text_pos pos;
int delta, delta_bytes;
+ int mouse_face_overwritten_p;
/* Not done directly. */
redisplay_performed_directly_p = 0;
DEFAULT_FACE_ID);
glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos);
+ if (glyph_row->mouse_face_p)
+ return 0;
/* Give up if highlighting trailing whitespace and we have trailing
whitespace in glyph_row. We would have to remove the trailing
}
if (rif)
- rif->update_window_end_hook (w, 1);
+ rif->update_window_end_hook (w, 1, 0);
update_end (f);
updated_row = NULL;
fflush (stdout);
struct window *w;
int yb;
{
- int i, bottom_y;
- struct glyph_row *row;
-
/* If rows overlapping others have been changed, the rows being
overlapped have to be redrawn. This won't draw lines that have
already been drawn in update_window_line because overlapped_p in
current rows is 0. */
for (i = 0; i < w->current_matrix->nrows; ++i)
{
- row = w->current_matrix->rows + i;
+ struct glyph_row *row = w->current_matrix->rows + i;
if (!row->enabled_p)
break;
row->overlapped_p = 0;
}
- bottom_y = MATRIX_ROW_BOTTOM_Y (row);
- if (bottom_y >= yb)
+ if (MATRIX_ROW_BOTTOM_Y (row) >= yb)
break;
}
}
struct glyph_row *row, *end;
struct glyph_row *mode_line_row;
struct glyph_row *header_line_row = NULL;
- int yb, changed_p = 0;
+ int yb, changed_p = 0, mouse_face_overwritten_p = 0;
rif->update_window_begin_hook (w);
yb = window_text_bottom_y (w);
{
mode_line_row->y = yb;
update_window_line (w, MATRIX_ROW_VPOS (mode_line_row,
- desired_matrix));
+ desired_matrix),
+ &mouse_face_overwritten_p);
changed_p = 1;
}
if (header_line_row && header_line_row->enabled_p)
{
header_line_row->y = 0;
- update_window_line (w, 0);
+ update_window_line (w, 0, &mouse_face_overwritten_p);
changed_p = 1;
}
if (!force_p && vpos % preempt_count == 0)
detect_input_pending ();
- changed_p |= update_window_line (w, vpos);
+ changed_p |= update_window_line (w, vpos,
+ &mouse_face_overwritten_p);
/* Mark all rows below the last visible one in the current
matrix as invalid. This is necessary because of
set_cursor:
/* Fix the appearance of overlapping(overlapped rows. */
- if (rif->fix_overlapping_area
- && !w->pseudo_window_p
- && changed_p
- && !paused_p)
- {
- redraw_overlapped_rows (w, yb);
- redraw_overlapping_rows (w, yb);
- }
-
if (!paused_p && !w->pseudo_window_p)
{
+ if (changed_p && rif->fix_overlapping_area)
+ {
+ redraw_overlapped_rows (w, yb);
+ redraw_overlapping_rows (w, yb);
+ }
+
/* Make cursor visible at cursor position of W. */
set_window_cursor_after_update (w);
-#if 0
- /* Check that current matrix invariants are satisfied. This
- is for debugging only. See the comment around
- check_matrix_invariants. */
+#if 0 /* Check that current matrix invariants are satisfied. This is
+ for debugging only. See the comment of check_matrix_invariants. */
IF_DEBUG (check_matrix_invariants (w));
#endif
}
#endif
/* End of update of window W. */
- rif->update_window_end_hook (w, 1);
-
+ rif->update_window_end_hook (w, 1, mouse_face_overwritten_p);
}
else
paused_p = 1;
changed. */
static int
-update_window_line (w, vpos)
+update_window_line (w, vpos, mouse_face_overwritten_p)
struct window *w;
- int vpos;
+ int vpos, *mouse_face_overwritten_p;
{
struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
if (!desired_row->full_width_p
&& !NILP (w->left_margin_width))
{
- update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
changed_p = 1;
+ update_marginal_area (w, LEFT_MARGIN_AREA, vpos);
}
/* Update the display of the text area. */
- changed_p |= update_text_area (w, vpos);
+ if (update_text_area (w, vpos))
+ {
+ changed_p = 1;
+ if (current_row->mouse_face_p)
+ *mouse_face_overwritten_p = 1;
+ }
/* Update display of the right margin area, if there is one. */
if (!desired_row->full_width_p
{
struct glyph_row *from, *to;
int to_overlapped_p;
-
+
to = MATRIX_ROW (current_matrix, r->desired_vpos + j);
- to_overlapped_p = to->overlapped_p;
from = MATRIX_ROW (desired_matrix, r->desired_vpos + j);
+ to_overlapped_p = to->overlapped_p;
+ xassert (!to->mouse_face_p);
assign_row (to, from);
to->enabled_p = 1, from->enabled_p = 0;
to->overlapped_p = to_overlapped_p;