summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-01 22:21:01 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-01 22:21:01 +0200
commit7866b87958cf0c2f3312f2c3d7fb8d6eed28b512 (patch)
treeb952f2359356a2c434aa747d67f1362a7a2e6295
parentf8a071265535b8cc43e50a81f4d5049883ca50e4 (diff)
patch 8.1.1615: crash when passing buffer number to popup_create()v8.1.1615
Problem: Crash when passing buffer number to popup_create(). (Yasuhiro Matsumoto) Solution: Initialze the window properly.
-rw-r--r--src/popupwin.c3
-rw-r--r--src/testdir/test_popupwin.vim5
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 2 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index 3af35b6f05..d988cbaf9b 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -1056,8 +1056,7 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
{
// use existing buffer
new_buffer = FALSE;
- wp->w_buffer = buf;
- ++buf->b_nwindows;
+ win_init_popup_win(wp, buf);
buffer_ensure_loaded(buf);
}
else
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 32ce96be11..f89d566023 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1668,4 +1668,9 @@ func Test_popupwin_with_buffer()
call assert_equal({}, popup_getpos(winid))
call assert_equal(1, bufloaded(buf))
exe 'bwipe! ' .. buf
+
+ edit test_popupwin.vim
+ let winid = popup_create(bufnr(''), {})
+ redraw
+ call popup_close(winid)
endfunc
diff --git a/src/version.c b/src/version.c
index 8a9f34743e..ec541b4679 100644
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1615,
+/**/
1614,
/**/
1613,