ui_pum_get_pos: return internal pum position if external pum pos not found

This commit is contained in:
Yatao Li
2020-03-03 17:43:02 +08:00
parent 630ec6cfb8
commit 9c85caa390
4 changed files with 40 additions and 41 deletions

View File

@@ -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)