mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
api/ui: allow set bounds row and col to be less than 0; ui_pum_get_pos: return first extui bounds information instead of reducing
This commit is contained in:
@@ -237,24 +237,18 @@ int ui_pum_get_height(void)
|
||||
|
||||
void ui_pum_get_pos(double *pwidth, double *pheight, double *prow, double *pcol)
|
||||
{
|
||||
double w = 0.0, h = 0.0, r = -1.0, c = -1.0;
|
||||
double w = 0.0, h = 0.0, r = 0.0, c = 0.0;
|
||||
bool found = false;
|
||||
for (size_t i = 1; i < ui_count; i++) {
|
||||
if (!uis[i]->pum_pos) {
|
||||
continue;
|
||||
}
|
||||
if (!found) {
|
||||
w = uis[i]->pum_width;
|
||||
h = uis[i]->pum_height;
|
||||
r = uis[i]->pum_row;
|
||||
c = uis[i]->pum_col;
|
||||
found = true;
|
||||
} else {
|
||||
w = MIN(uis[i]->pum_width, w);
|
||||
h = MIN(uis[i]->pum_height, h);
|
||||
r = MIN(uis[i]->pum_row, r);
|
||||
c = MIN(uis[i]->pum_col, c);
|
||||
}
|
||||
w = uis[i]->pum_width;
|
||||
h = uis[i]->pum_height;
|
||||
r = uis[i]->pum_row;
|
||||
c = uis[i]->pum_col;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if (found) {
|
||||
*pwidth = w;
|
||||
|
Reference in New Issue
Block a user