aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui.c
diff options
context:
space:
mode:
authorYatao Li <yatli@microsoft.com>2020-03-03 18:17:37 +0800
committerYatao Li <yatli@microsoft.com>2020-04-28 01:53:05 +0800
commit6da16ac931eec7be2487ee98e7f605fa12b0171d (patch)
tree3835e1fee5c75f5f54c0cbc6f23ef5ccefe1c37a /src/nvim/ui.c
parent9c85caa390ccf6295233c4201a60ccfa66417816 (diff)
downloadrneovim-6da16ac931eec7be2487ee98e7f605fa12b0171d.tar.gz
rneovim-6da16ac931eec7be2487ee98e7f605fa12b0171d.tar.bz2
rneovim-6da16ac931eec7be2487ee98e7f605fa12b0171d.zip
external pum: use floating point geometry; typval: add tv_dict_add_float
Diffstat (limited to 'src/nvim/ui.c')
-rw-r--r--src/nvim/ui.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 9ab868c78e..cc9bf42bc8 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -235,12 +235,14 @@ int ui_pum_get_height(void)
return pum_height;
}
-void ui_pum_get_pos(int* pwidth, int *pheight, int* prow, int* pcol)
+void ui_pum_get_pos(double *pwidth, double *pheight, double *prow, double *pcol)
{
- int w=0,h=0,r=-1,c=-1;
+ double w = 0.0, h = 0.0, r = -1.0, c = -1.0;
bool found = false;
for (size_t i = 1; i < ui_count; i++) {
- if (!uis[i]->pum_pos) continue;
+ if (!uis[i]->pum_pos) {
+ continue;
+ }
if (!found) {
w = uis[i]->pum_width;
h = uis[i]->pum_height;
@@ -260,7 +262,12 @@ void ui_pum_get_pos(int* pwidth, int *pheight, int* prow, int* pcol)
*prow = r;
*pcol = c;
} else {
- pum_get_internal_pos(pwidth, pheight, prow, pcol);
+ int iw, ih, ir, ic;
+ pum_get_internal_pos(&iw, &ih, &ir, &ic);
+ *pwidth = (double)iw;
+ *pheight = (double)ih;
+ *prow = (double)ir;
+ *pcol = (double)ic;
}
}