diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-10 23:44:48 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-10 23:44:48 +0100 |
commit | 99ebf22c523e3fdb491b2c92b6f3a7d42721361d (patch) | |
tree | adbbfce6afde2d201db98feb8413244d4a9d0272 /src/testdir/test_popupwin.vim | |
parent | 1e46705a83ef2bbabd4a53ec40108558b73ed54f (diff) | |
download | vim-git-99ebf22c523e3fdb491b2c92b6f3a7d42721361d.tar.gz |
patch 8.1.2418: bufnr('$') is wrong after recycling popup bufferv8.1.2418
Problem: bufnr('$') is wrong after recycling popup buffer.
Solution: Sort the buffer list by buffer number. (closes #5335)
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r-- | src/testdir/test_popupwin.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index dc2274346..5d7f46f9a 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -3168,4 +3168,21 @@ func Test_popupwin_sign() call delete('XtestPopupSign') endfunc +func Test_popupwin_bufnr() + let popwin = popup_create(['blah'], #{}) + let popbuf = winbufnr(popwin) + split asdfasdf + let newbuf = bufnr() + call assert_true(newbuf > popbuf, 'New buffer number is higher') + call assert_equal(newbuf, bufnr('$')) + call popup_clear() + let popwin = popup_create(['blah'], #{}) + " reuses previous buffer number + call assert_equal(popbuf, winbufnr(popwin)) + call assert_equal(newbuf, bufnr('$')) + + call popup_clear() + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 |