From d372c804aa33a272f6659f6d08d5dfee704d30d9 Mon Sep 17 00:00:00 2001 From: Yatao Li Date: Sun, 22 Mar 2020 17:27:49 +0800 Subject: 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 --- src/nvim/api/ui.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/nvim/api/ui.c') diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index b10434428c..300f409a0f 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -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; } -- cgit