mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
vim-patch:8.1.0355 Incorrect adjusting the popup menu (#8996)
Problem: Incorrect adjusting the popup menu for the preview window. Solution: Compute position and height properl. (Ronan Pigott) Also show at least ten items. (closes vim/vim#3414)
This commit is contained in:

committed by
Justin M. Keyes

parent
3bce5207cf
commit
9ed46a77e6
@@ -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.
|
||||
|
Reference in New Issue
Block a user