diff options
Diffstat (limited to 'src/popupmnu.c')
-rw-r--r-- | src/popupmnu.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c index 6ef0af92a2..962a59a1bf 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -1195,6 +1195,14 @@ pum_show_popupmenu(vimmenu_T *menu) || (mp->modes & mp->enabled & mode)) ++pum_size; + // When there are only Terminal mode menus, using "popup Edit" results in + // pum_size being zero. + if (pum_size <= 0) + { + EMSG(e_menuothermode); + return; + } + array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * pum_size); if (array == NULL) return; |