diff options
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r-- | src/nvim/ui.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c index e7cc3b4e36..9ab868c78e 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -226,7 +226,7 @@ int ui_pum_get_height(void) { int pum_height = 0; for (size_t i = 1; i < ui_count; i++) { - int ui_pum_height = uis[i]->pum_height; + int ui_pum_height = uis[i]->pum_nlines; if (ui_pum_height) { pum_height = pum_height != 0 ? MIN(pum_height, ui_pum_height) : ui_pum_height; @@ -235,7 +235,7 @@ int ui_pum_get_height(void) return pum_height; } -bool ui_pum_get_pos(int* pwidth, int *pheight, int* prow, int* pcol) +void ui_pum_get_pos(int* pwidth, int *pheight, int* prow, int* pcol) { int w=0,h=0,r=-1,c=-1; bool found = false; @@ -254,11 +254,14 @@ bool ui_pum_get_pos(int* pwidth, int *pheight, int* prow, int* pcol) c = MIN(uis[i]->pum_col, c); } } - *pwidth = w; - *pheight = h; - *prow = r; - *pcol = c; - return found; + if (found) { + *pwidth = w; + *pheight = h; + *prow = r; + *pcol = c; + } else { + pum_get_internal_pos(pwidth, pheight, prow, pcol); + } } static void ui_refresh_event(void **argv) |