diff options
Diffstat (limited to 'src/nvim/popupmnu.c')
-rw-r--r-- | src/nvim/popupmnu.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 4c51f5de5e..68c8967b91 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -201,9 +201,15 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed) } // If there is a preview window above, avoid drawing over it. - if (pvwin != NULL && pum_row < above_row && pum_height > above_row) { - pum_row += above_row; - pum_height -= above_row; + // Do keep at least 10 entries. + if (pvwin != NULL && pum_row < above_row && pum_height > 10) { + if (row - above_row < 10) { + pum_row = row - 10; + pum_height = 10; + } else { + pum_row = above_row; + pum_height = row - above_row; + } } // Compute the width of the widest match and the widest extra. |