Mercurial > vim
diff src/testdir/test_winbuf_close.vim @ 13837:79419af4b29c v8.0.1790
patch 8.0.1790: 'winfixwidth' is not always respected by :close
commit https://github.com/vim/vim/commit/c136af29c0b1939076fbae7d36afd90dce740315
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri May 4 20:15:38 2018 +0200
patch 8.0.1790: 'winfixwidth' is not always respected by :close
Problem: 'winfixwidth' is not always respected by :close.
Solution: Prefer a frame without 'winfixwidth' or 'winfixheight'. (Jason
Franklin)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 04 May 2018 20:30:06 +0200 |
parents | 4767939d10cc |
children | a3284dd27de6 |
line wrap: on
line diff
--- a/src/testdir/test_winbuf_close.vim +++ b/src/testdir/test_winbuf_close.vim @@ -122,3 +122,39 @@ func Test_winbuf_close() call delete('Xtest2') call delete('Xtest3') endfunc + +" Test that ":close" will respect 'winfixheight' when possible. +func Test_winfixheight_on_close() + set nosplitbelow nosplitright + + split | split | vsplit + + $wincmd w + setlocal winfixheight + let l:height = winheight(0) + + 3close + + call assert_equal(l:height, winheight(0)) + + %bwipeout! + setlocal nowinfixheight splitbelow& splitright& +endfunc + +" Test that ":close" will respect 'winfixwidth' when possible. +func Test_winfixwidth_on_close() + set nosplitbelow nosplitright + + vsplit | vsplit | split + + $wincmd w + setlocal winfixwidth + let l:width = winwidth(0) + + 3close + + call assert_equal(l:width, winwidth(0)) + + %bwipeout! + setlocal nowinfixwidth splitbelow& splitright& +endfunction