diff options
-rw-r--r-- | src/popupwin.c | 6 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 19 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index b0895528e9..1122f48e72 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -3331,8 +3331,12 @@ popup_update_mask(win_T *wp, int width, int height) char_u *cells; int row, col; - if (wp->w_popup_mask == NULL) + if (wp->w_popup_mask == NULL || width == 0 || height == 0) + { + vim_free(wp->w_popup_mask_cells); + wp->w_popup_mask_cells = NULL; return; + } if (wp->w_popup_mask_cells != NULL && wp->w_popup_mask_height == height && wp->w_popup_mask_width == width) diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 7f5895f967..44b18005fd 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -825,6 +825,25 @@ func Test_popup_with_mask() " this was causing a crash call popup_create('test', #{mask: [[0, 0, 0, 0]]}) call popup_clear() + + " this was causing an internal error + enew + set nowrap + call repeat('x', &columns)->setline(1) + call prop_type_add('textprop', {}) + call prop_add(1, 1, #{length: &columns, type: 'textprop'}) + vsplit + let opts = popup_create('', #{textprop: 'textprop'}) + \ ->popup_getoptions() + \ ->extend(#{mask: [[1, 1, 1, 1]]}) + call popup_create('', opts) + redraw + + close! + bwipe! + call prop_type_delete('textprop') + call popup_clear() + set wrap& endfunc func Test_popup_select() diff --git a/src/version.c b/src/version.c index 5601c58aa3..264df9bf11 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2510, +/**/ 2509, /**/ 2508, |