diff options
Diffstat (limited to 'src/nvim/popupmnu.c')
-rw-r--r-- | src/nvim/popupmnu.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 69c614fff9..32c9750628 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -140,7 +140,9 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, } pum_anchor_grid = (int)curwin->w_grid.target->handle; - if (!ui_has(kUIMultigrid)) { + pum_win_row += curwin->w_grid.row_offset; + cursor_col += curwin->w_grid.col_offset; + if (!ui_has(kUIMultigrid) && curwin->w_grid.target != &default_grid) { pum_anchor_grid = (int)default_grid.handle; pum_win_row += curwin->w_winrow; cursor_col += curwin->w_wincol; @@ -396,7 +398,7 @@ void pum_redraw(void) char_u *p = NULL; int totwidth, width, w; int thumb_pos = 0; - int thumb_heigth = 1; + int thumb_height = 1; int round; int n; @@ -447,11 +449,11 @@ void pum_redraw(void) } if (pum_scrollbar) { - thumb_heigth = pum_height * pum_height / pum_size; - if (thumb_heigth == 0) { - thumb_heigth = 1; + thumb_height = pum_height * pum_height / pum_size; + if (thumb_height == 0) { + thumb_height = 1; } - thumb_pos = (pum_first * (pum_height - thumb_heigth) + thumb_pos = (pum_first * (pum_height - thumb_height) + (pum_size - pum_height) / 2) / (pum_size - pum_height); } @@ -614,11 +616,11 @@ void pum_redraw(void) if (pum_scrollbar > 0) { if (pum_rl) { grid_putchar(&pum_grid, ' ', row, col_off - pum_width, - i >= thumb_pos && i < thumb_pos + thumb_heigth + i >= thumb_pos && i < thumb_pos + thumb_height ? attr_thumb : attr_scroll); } else { grid_putchar(&pum_grid, ' ', row, col_off + pum_width, - i >= thumb_pos && i < thumb_pos + thumb_heigth + i >= thumb_pos && i < thumb_pos + thumb_height ? attr_thumb : attr_scroll); } } |