mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
patch 8.1.1615: crash when passing buffer number to popup_create()
Problem: Crash when passing buffer number to popup_create(). (Yasuhiro Matsumoto) Solution: Initialze the window properly.
This commit is contained in:
@@ -1056,8 +1056,7 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
|
|||||||
{
|
{
|
||||||
// use existing buffer
|
// use existing buffer
|
||||||
new_buffer = FALSE;
|
new_buffer = FALSE;
|
||||||
wp->w_buffer = buf;
|
win_init_popup_win(wp, buf);
|
||||||
++buf->b_nwindows;
|
|
||||||
buffer_ensure_loaded(buf);
|
buffer_ensure_loaded(buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -1668,4 +1668,9 @@ func Test_popupwin_with_buffer()
|
|||||||
call assert_equal({}, popup_getpos(winid))
|
call assert_equal({}, popup_getpos(winid))
|
||||||
call assert_equal(1, bufloaded(buf))
|
call assert_equal(1, bufloaded(buf))
|
||||||
exe 'bwipe! ' .. buf
|
exe 'bwipe! ' .. buf
|
||||||
|
|
||||||
|
edit test_popupwin.vim
|
||||||
|
let winid = popup_create(bufnr(''), {})
|
||||||
|
redraw
|
||||||
|
call popup_close(winid)
|
||||||
endfunc
|
endfunc
|
||||||
|
@@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1615,
|
||||||
/**/
|
/**/
|
||||||
1614,
|
1614,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user