aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/popupmenu.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-28 06:23:19 +0800
committerGitHub <noreply@github.com>2023-04-28 06:23:19 +0800
commit50107c37782fdeae7ad498c29d37a48cac87d657 (patch)
tree4ebb0cab3b8af3899ef4cdd0325598e6dab1b020 /src/nvim/popupmenu.c
parentf65043154e023263bc98057b1792893ef2bfee18 (diff)
parentaca226d728418e791b897a908631d52aa24157fe (diff)
downloadrneovim-50107c37782fdeae7ad498c29d37a48cac87d657.tar.gz
rneovim-50107c37782fdeae7ad498c29d37a48cac87d657.tar.bz2
rneovim-50107c37782fdeae7ad498c29d37a48cac87d657.zip
Merge pull request #23352 from zeertzjq/pum-at-cursor
fix(pum): make :popup position correctly with float border
Diffstat (limited to 'src/nvim/popupmenu.c')
-rw-r--r--src/nvim/popupmenu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index aa50f04c33..3246ef2c71 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -1169,8 +1169,15 @@ void pum_make_popup(const char *path_name, int use_mouse_pos)
if (!use_mouse_pos) {
// Hack: set mouse position at the cursor so that the menu pops up
// around there.
- mouse_row = curwin->w_winrow + curwin->w_wrow;
- mouse_col = curwin->w_wincol + curwin->w_wcol;
+ mouse_row = curwin->w_grid.row_offset + curwin->w_wrow;
+ mouse_col = curwin->w_grid.col_offset + curwin->w_wcol;
+ if (ui_has(kUIMultigrid)) {
+ mouse_grid = curwin->w_grid.target->handle;
+ } else if (curwin->w_grid.target != &default_grid) {
+ mouse_grid = 0;
+ mouse_row += curwin->w_winrow;
+ mouse_col += curwin->w_wincol;
+ }
}
vimmenu_T *menu = menu_find(path_name);