aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-04-27 21:12:12 +0200
committerGitHub <noreply@github.com>2020-04-27 21:12:12 +0200
commitc7d3630e214012667e855c30cde2808a5fe59650 (patch)
treecc2024053865052d34e7e8ebebbd45a4064d29ee /src/nvim/ui.c
parentd90a92bcd3c18111abb62a57192c9e151839a7f4 (diff)
parente34684b2ad02e759dec39c0f0958c7882120ecdc (diff)
downloadrneovim-c7d3630e214012667e855c30cde2808a5fe59650.tar.gz
rneovim-c7d3630e214012667e855c30cde2808a5fe59650.tar.bz2
rneovim-c7d3630e214012667e855c30cde2808a5fe59650.zip
Merge pull request #11943 from yatli/master
[RDY] API/UI: Allow UI to set PUM position and size, and pass the position to CompleteChanged
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r--src/nvim/ui.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 3a5aa95ad3..685da77b39 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -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,6 +235,21 @@ int ui_pum_get_height(void)
return pum_height;
}
+bool ui_pum_get_pos(double *pwidth, double *pheight, double *prow, double *pcol)
+{
+ for (size_t i = 1; i < ui_count; i++) {
+ if (!uis[i]->pum_pos) {
+ continue;
+ }
+ *pwidth = uis[i]->pum_width;
+ *pheight = uis[i]->pum_height;
+ *prow = uis[i]->pum_row;
+ *pcol = uis[i]->pum_col;
+ return true;
+ }
+ return false;
+}
+
static void ui_refresh_event(void **argv)
{
ui_refresh();