Commit 648fa17d authored by Jim Blandy's avatar Jim Blandy

* dispnew.c: Incude "systty.h", not "systerm.h".

	* dispnew.c (update_frame): Change the way we handle
	cursor_in_echo_area.  Firstly, ignore this if the frame we're
	updating doesn't have a minibuffer.  Secondly, don't handle the
	selected frame specially.  Thirdly, don't assume that the
	minibuffer is only one line high.  If cursor_in_echo_area < 0, put
	the cursor in the upper-left corner; if cursor_in_echo_area > 0,
	put it on the lowest non-empty line in the minibuffer window, or
	on the top line.

	* dispnew.c (direct_output_for_insert): Fail if
	cursor_in_echo_area is set; we don't want to do the typing there.
	(direct_output_for_insert): Same.
parent 3f5fcd47
......@@ -36,7 +36,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "disptab.h"
#include "indent.h"
#include "systerm.h"
#include "systty.h"
#include "systime.h"
#ifdef HAVE_X_WINDOWS
......@@ -874,6 +874,7 @@ direct_output_for_insert (g)
|| (XINT (w->hscroll) && hpos == XFASTINT (w->left))
/* Give up if cursor outside window (in minibuf, probably) */
|| cursor_in_echo_area
|| FRAME_CURSOR_Y (frame) < XFASTINT (w->top)
|| FRAME_CURSOR_Y (frame) >= XFASTINT (w->top) + XFASTINT (w->height)
......@@ -922,7 +923,8 @@ direct_output_forward_char (n)
&& (FRAME_CURSOR_X (frame) + 1
>= (XFASTINT (w->left) + XFASTINT (w->width)
- (XFASTINT (w->width) < FRAME_WIDTH (frame))
- 1))))
- 1)))
|| cursor_in_echo_area)
return 0;
FRAME_CURSOR_X (frame) += n;
......@@ -1052,18 +1054,41 @@ update_frame (f, force, inhibit_hairy_id)
/* Now just clean up termcap drivers and set cursor, etc. */
if (!pause)
{
if (cursor_in_echo_area)
if (cursor_in_echo_area
&& FRAME_HAS_MINIBUF_P (f))
{
if (f == selected_frame
&& cursor_in_echo_area < 0)
cursor_to (FRAME_HEIGHT (f) - 1, 0);
else if (f == selected_frame
&& ! current_frame->enable[FRAME_HEIGHT (f) - 1])
cursor_to (FRAME_HEIGHT (f) - 1, 0);
int top = XINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top);
int row, col;
if (cursor_in_echo_area < 0)
{
row = top;
col = 0;
}
else
cursor_to (FRAME_HEIGHT (f) - 1,
min (FRAME_WIDTH (f) - 1,
current_frame->used[FRAME_HEIGHT (f) - 1]));
{
/* If the minibuffer is several lines high, find the last
line that has any text on it. */
row = FRAME_HEIGHT (f);
do
{
row--;
if (current_frame->enable[row])
col = current_frame->used[row];
else
col = 0;
}
while (row > top && col == 0);
if (col >= FRAME_WIDTH (f))
{
col = 0;
if (row < FRAME_HEIGHT (f) - 1)
row++;
}
}
cursor_to (row, col);
}
else
cursor_to (FRAME_CURSOR_Y (f), max (min (FRAME_CURSOR_X (f),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment