/* Nonzero if overlay arrow has been displayed once in this window. */
static int overlay_arrow_seen;
+/* Nonzero means highlight the region even in nonselected windows. */
+static int highlight_nonselected_windows;
+
/* If cursor motion alone moves point off frame,
Try scrolling this many lines up or down if that will bring it back. */
int scroll_step;
if (frame_garbaged)
{
- Fredraw_display ();
+ redraw_garbaged_frames ();
frame_garbaged = 0;
}
if (frame_garbaged)
{
- Fredraw_display ();
+ redraw_garbaged_frames ();
frame_garbaged = 0;
}
else if (just_this_one && !MINI_WINDOW_P (w)
&& point >= startp
&& XFASTINT (w->last_modified)
+ /* or else vmotion on first line won't work. */
+ && ! NILP (w->start_at_line_beg)
&& ! EQ (w->window_end_valid, Qnil)
&& do_id && !clip_changed
&& !blank_end_of_window
int start, end, whole;
/* Calculate the start and end positions for the current window.
+ At some point, it would be nice to choose between scrollbars
+ which reflect the whole buffer size, with special markers
+ indicating narrowing, and scrollbars which reflect only the
+ visible region.
+
Note that minibuffers sometimes aren't displaying any text. */
if (! MINI_WINDOW_P (w)
|| (w == XWINDOW (minibuf_window) && ! echo_area_glyphs))
{
- start = startp;
+ whole = ZV - BEGV;
+ start = startp - BEGV;
/* I don't think this is guaranteed to be right. For the
moment, we'll pretend it is. */
- end = Z - XINT (w->window_end_pos);
- whole = Z - BEG;
+ end = (Z - XINT (w->window_end_pos)) - BEGV;
+
+ if (end < start) end = start;
+ if (whole < (end - start)) whole = end - start;
}
else
start = end = whole = 0;
register unsigned char *p;
GLYPH *endp;
register GLYPH *startp;
- register GLYPH *p1prev;
+ register GLYPH *p1prev = 0;
FRAME_PTR f = XFRAME (w->frame);
int tab_width = XINT (current_buffer->tab_width);
int ctl_arrow = !NILP (current_buffer->ctl_arrow);
if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
/* Show where to highlight the region. */
- if (highlight_region && XMARKER (current_buffer->mark)->buffer != 0)
+ if (highlight_region && XMARKER (current_buffer->mark)->buffer != 0
+ /* Maybe highlight only in selected window. */
+ && (highlight_nonselected_windows
+ || w == XWINDOW (selected_window)))
{
region_beg = marker_position (current_buffer->mark);
if (PT < region_beg)
/* Did we hit a face change? Figure out what face we should
use now. We also hit this the first time through the
loop, to see what face we should start with. */
- if (pos == next_face_change)
+ if (pos == next_face_change && FRAME_X_P (f))
current_face = compute_char_face (f, w, pos,
region_beg, region_end,
&next_face_change);
copy_part_of_rope (p1prev, p1prev, invis_vector_contents,
(p1 - p1prev), current_face);
}
+#if 1
+ /* Draw the face of the newline character as extending all the
+ way to the end of the frame line. */
+ if (current_face)
+ while (p1 < endp)
+ *p1++ = MAKE_GLYPH (' ', current_face);
+#endif
break;
}
else if (c == '\t')
copy_part_of_rope (p1prev, p1prev, invis_vector_contents,
(p1 - p1prev), current_face);
}
+#if 1
+ /* Draw the face of the newline character as extending all the
+ way to the end of the frame line. */
+ if (current_face)
+ while (p1 < endp)
+ *p1++ = MAKE_GLYPH (' ', current_face);
+#endif
break;
}
else if (dp != 0 && XTYPE (DISP_CHAR_VECTOR (dp, c)) == Lisp_Vector)
/* by backing up over it */
if (p1 > endp)
{
- /* Start the next line with that same character */
- pos--;
- /* but at a negative hpos, to skip the columns output on this line. */
- val.hpos += p1prev - endp;
+ /* Don't back up if we never actually displayed any text.
+ This occurs when the minibuffer prompt takes up the whole line. */
+ if (p1prev)
+ {
+ /* Start the next line with that same character */
+ pos--;
+ /* but at negative hpos, to skip the columns output on this line. */
+ val.hpos += p1prev - endp;
+ }
+
/* Keep in this line everything up to the continuation column. */
p1 = endp;
}
DEFVAR_INT ("line-number-display-limit", &line_number_display_limit,
"*Maximum buffer size for which line number should be displayed.");
line_number_display_limit = 1000000;
+
+ DEFVAR_BOOL ("highlight-nonselected-windows", &highlight_nonselected_windows,
+ "*Non-nil means highlight region even in nonselected windows.");
+ highlight_nonselected_windows = 1;
}
/* initialize the window system */