aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy <[email protected]>1992-08-29 02:55:05 +0000
committerJim Blandy <[email protected]>1992-08-29 02:55:05 +0000
commit648fa17da60726950f3b318c4d55643ed44d54c8 (patch)
tree5e4ef4c5df63c9fed44d0f62496c34f7d0c8d52b
parent3f5fcd47341a31352fd8e3da25c8c12b96ad9a27 (diff)
* 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.
-rw-r--r--src/dispnew.c49
1 files changed, 37 insertions, 12 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index ea1f64434a..9bfeb0505c 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -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),