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:
Yatao Li
2020-03-22 17:27:49 +08:00
parent ed6230434b
commit d372c804aa
3 changed files with 15 additions and 29 deletions

View File

@@ -382,17 +382,11 @@ void nvim_ui_pum_set_bounds(uint64_t channel_id, Float width, Float height,
return;
}
if (row < 0) {
api_set_error(err, kErrorTypeValidation, "Expected pumpos row >= 0");
return;
} else if (col < 0) {
api_set_error(err, kErrorTypeValidation, "Expected pumpos col >= 0");
return;
} else if (width <= 0) {
api_set_error(err, kErrorTypeValidation, "Expected pumpos width > 0");
if (width <= 0) {
api_set_error(err, kErrorTypeValidation, "Expected width > 0");
return;
} else if (height <= 0) {
api_set_error(err, kErrorTypeValidation, "Expected pumpos height > 0");
api_set_error(err, kErrorTypeValidation, "Expected height > 0");
return;
}