From 92abd968e388b00054efb377c134a08fcabfae37 Mon Sep 17 00:00:00 2001 From: skimo Date: Sun, 22 Apr 2001 19:55:52 +0000 Subject: [PATCH] Discard screens when moving them to the hidden queue. Fixes serious confusion when going to ex mode with split screens and then later going back to vi mode. Also discard the current screen right before going to ex mode, since the curses private data is wrong at this stage. --- cl/cl_funcs.c | 14 +++++++------- vi/vi.c | 4 +++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cl/cl_funcs.c b/cl/cl_funcs.c index 04ed6ed0..4abf55fc 100644 --- a/cl/cl_funcs.c +++ b/cl/cl_funcs.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: cl_funcs.c,v 10.63 2001/04/21 06:36:24 skimo Exp $ (Berkeley) $Date: 2001/04/21 06:36:24 $"; +static const char sccsid[] = "$Id: cl_funcs.c,v 10.64 2001/04/22 19:55:52 skimo Exp $ (Berkeley) $Date: 2001/04/22 19:55:52 $"; #endif /* not lint */ #include @@ -396,13 +396,13 @@ cl_discard(discardp, acquirep) SCR* tsp; if (discardp) { - clp = CLP(discardp); - F_SET(clp, CL_LAYOUT); + clp = CLP(discardp); + F_SET(clp, CL_LAYOUT); - if (CLSP(discardp)) { - delwin(CLSP(discardp)); - CLSP(discardp) = NULL; - } + if (CLSP(discardp)) { + delwin(CLSP(discardp)); + CLSP(discardp) = NULL; + } } /* no screens got a piece; we're done */ diff --git a/vi/vi.c b/vi/vi.c index e53abf3c..f356b047 100644 --- a/vi/vi.c +++ b/vi/vi.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: vi.c,v 10.70 2000/07/15 20:26:36 skimo Exp $ (Berkeley) $Date: 2000/07/15 20:26:36 $"; +static const char sccsid[] = "$Id: vi.c,v 10.71 2001/04/22 19:55:52 skimo Exp $ (Berkeley) $Date: 2001/04/22 19:55:52 $"; #endif /* not lint */ #include @@ -402,6 +402,7 @@ intr: CLR_INTERRUPT(sp); if (F_ISSET(gp, G_SRESTART) || F_ISSET(sp, SC_EX)) { *spp = sp; v_dtoh(sp); + gp->scr_discard(sp, NULL); break; } } @@ -1038,6 +1039,7 @@ v_dtoh(sp) CIRCLEQ_INSERT_TAIL(&gp->hq, tsp, q); /* XXXX Change if hidden screens per window */ tsp->wp = 0; + gp->scr_discard(tsp, NULL); } /* Move current screen back to the display queue. */ -- 2.11.4.GIT