From e376db308113ff2b5bb46383cd7709153fc12a6b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Feb 2002 08:18:03 +0000 Subject: [PATCH] (enlarge_window): Fix last change. --- src/ChangeLog | 4 ++++ src/window.c | 24 ++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 183d10a3700..e46003e4ca1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2002-02-02 Richard M. Stallman + + * window.c (enlarge_window): Fix last change. + 2002-02-01 Kim F. Storm * xterm.c (x_erase_phys_cursor): Don't erase cursor if cursor row diff --git a/src/window.c b/src/window.c index 81a64db55c0..c58fd2f36b0 100644 --- a/src/window.c +++ b/src/window.c @@ -3525,17 +3525,29 @@ enlarge_window (window, delta, widthflag) { /* If trying to grow this window to or beyond size of the parent, just delete all the sibling windows. */ - Lisp_Object tem, next; + Lisp_Object start, tem, next; - tem = XWINDOW (parent)->vchild; - if (NILP (tem)) - tem = XWINDOW (parent)->hchild; + start = XWINDOW (parent)->vchild; + if (NILP (start)) + start = XWINDOW (parent)->hchild; + /* Delete any siblings that come after WINDOW. */ + tem = XWINDOW (window)->next; while (! NILP (tem)) { next = XWINDOW (tem)->next; - if (!EQ (tem, window)) - delete_window (tem); + delete_window (tem); + tem = next; + } + + /* Delete any siblings that come after WINDOW. + Note that if START is not WINDOW, then WINDOW still + Fhas siblings, so WINDOW has not yet replaced its parent. */ + tem = start; + while (! EQ (tem, window)) + { + next = XWINDOW (tem)->next; + delete_window (tem); tem = next; } } -- 2.39.5