summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-10 23:44:48 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-10 23:44:48 +0100
commit99ebf22c523e3fdb491b2c92b6f3a7d42721361d (patch)
treeadbbfce6afde2d201db98feb8413244d4a9d0272 /src/testdir
parent1e46705a83ef2bbabd4a53ec40108558b73ed54f (diff)
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')
-rw-r--r--src/testdir/test_popupwin.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index dc22743462..5d7f46f9a3 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