diff options
author | Yatao Li <yatli@microsoft.com> | 2020-03-03 17:43:02 +0800 |
---|---|---|
committer | Yatao Li <yatli@microsoft.com> | 2020-04-28 01:52:01 +0800 |
commit | 9c85caa390ccf6295233c4201a60ccfa66417816 (patch) | |
tree | be0a70d66296ab97791a33de03ff0c023fdeb0f9 /src/nvim/ui.c | |
parent | 630ec6cfb8670607ddfc67dd4e56e98c17746ca6 (diff) | |
download | rneovim-9c85caa390ccf6295233c4201a60ccfa66417816.tar.gz rneovim-9c85caa390ccf6295233c4201a60ccfa66417816.tar.bz2 rneovim-9c85caa390ccf6295233c4201a60ccfa66417816.zip |
ui_pum_get_pos: return internal pum position if external pum pos not found
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) |