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/api/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/api/ui.c')
-rw-r--r-- | src/nvim/api/ui.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index d2d1355207..430be920e2 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -357,11 +357,11 @@ void nvim_ui_pum_set_height(uint64_t channel_id, Integer height, Error *err) /// including visual decorations such as boarders and sliders. /// /// @param channel_id -/// @param width Popupmenu width, must be greater than zero. -/// @param height Popupmenu height, must be greater than zero. -/// @param row Popupmenu row, must be greater or equal to zero. -/// @param col Popupmenu height, must be greater or equal to zero. -/// @param[out] err Error details, if any. On error, suspend pum position reporting for the current UI. +/// @param width Popupmenu width. +/// @param height Popupmenu height. +/// @param row Popupmenu row. +/// @param col Popupmenu height. +/// @param[out] err Error details, if any. void nvim_ui_pum_set_bounds(uint64_t channel_id, Integer width, Integer height, Integer row, Integer col, Error *err) FUNC_API_SINCE(6) FUNC_API_REMOTE_ONLY @@ -375,31 +375,21 @@ void nvim_ui_pum_set_bounds(uint64_t channel_id, Integer width, Integer height, UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); if (!ui->ui_ext[kUIPopupmenu]) { api_set_error(err, kErrorTypeValidation, - "It must support the ext_popupmenu option"); + "UI must support the ext_popupmenu option"); return; } if (row < 0) { api_set_error(err, kErrorTypeValidation, "Expected pumpos row >= 0"); - ui->pum_pos = false; return; - } - - if (col < 0) { + } else if (col < 0) { api_set_error(err, kErrorTypeValidation, "Expected pumpos col >= 0"); - ui->pum_pos = false; return; - } - - if (width <= 0) { + } else if (width <= 0) { api_set_error(err, kErrorTypeValidation, "Expected pumpos width > 0"); - ui->pum_pos = false; return; - } - - if (height <= 0) { + } else if (height <= 0) { api_set_error(err, kErrorTypeValidation, "Expected pumpos height > 0"); - ui->pum_pos = false; return; } |