To: vim_dev@googlegroups.com Subject: Patch 8.2.0580 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0580 Problem: Window size wrong if 'ea' is off and 'splitright' is on and splitting then closing a window. Solution: Put abandoned window space in the right place. (Mark Waggoner) Files: src/testdir/test_winbuf_close.vim, src/window.c *** ../vim-8.2.0579/src/testdir/test_winbuf_close.vim 2020-01-20 21:44:28.427348596 +0100 --- src/testdir/test_winbuf_close.vim 2020-04-15 19:40:24.963918692 +0200 *************** *** 194,196 **** --- 194,215 ---- call assert_true(v:true) %bwipe! endfunc + + " Test when closing a split window (above/below) restores space to the window + " below when 'noequalalways' and 'splitright' are set. + func Test_window_close_splitright_noequalalways() + set noequalalways + set splitright + new + let w1 = win_getid() + new + let w2 = win_getid() + execute "normal \b" + let h = winheight(0) + let w = win_getid() + new + q + call assert_equal(h, winheight(0), "Window height does not match eight before opening and closing another window") + call assert_equal(w, win_getid(), "Did not return to original window after opening and closing a window") + endfunc + *** ../vim-8.2.0579/src/window.c 2020-04-02 18:50:42.431773081 +0200 --- src/window.c 2020-04-15 19:43:10.355494918 +0200 *************** *** 2967,2975 **** if (frp->fr_next == NULL) return frp->fr_prev; target_fr = frp->fr_next; other_fr = frp->fr_prev; ! if (p_spr || p_sb) { target_fr = frp->fr_prev; other_fr = frp->fr_next; --- 2967,2988 ---- if (frp->fr_next == NULL) return frp->fr_prev; + // By default the next window will get the space that was abandoned by this + // window target_fr = frp->fr_next; other_fr = frp->fr_prev; ! ! // If this is part of a column of windows and 'splitbelow' is true then the ! // previous window will get the space. ! if (frp->fr_parent != NULL && frp->fr_parent->fr_layout == FR_COL && p_sb) ! { ! target_fr = frp->fr_prev; ! other_fr = frp->fr_next; ! } ! ! // If this is part of a row of windows, and 'splitright' is true then the ! // previous window will get the space. ! if (frp->fr_parent != NULL && frp->fr_parent->fr_layout == FR_ROW && p_spr) { target_fr = frp->fr_prev; other_fr = frp->fr_next; *** ../vim-8.2.0579/src/version.c 2020-04-14 20:56:27.589970249 +0200 --- src/version.c 2020-04-15 20:05:29.924090433 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 580, /**/ -- ARTHUR: Be quiet! I order you to shut up. OLD WOMAN: Order, eh -- who does he think he is? ARTHUR: I am your king! OLD WOMAN: Well, I didn't vote for you. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///