0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.1520: popup windows are ignored when dealing with mouse position

Problem:    Popup windows are ignored when dealing with mouse position
Solution:   Find the mouse position inside a popup window.  Allow for modeless
            selection.
This commit is contained in:
Bram Moolenaar
2019-06-12 20:22:27 +02:00
parent 06e2c81f6d
commit 451d4b5b7c
12 changed files with 120 additions and 27 deletions

View File

@@ -423,6 +423,28 @@ add_popup_dicts(buf_T *buf, list_T *l)
}
}
/*
* Return the height of popup window "wp", including border and padding.
*/
int
popup_height(win_T *wp)
{
return wp->w_height
+ wp->w_popup_padding[0] + wp->w_popup_border[0]
+ wp->w_popup_padding[2] + wp->w_popup_border[2];
}
/*
* Return the width of popup window "wp", including border and padding.
*/
int
popup_width(win_T *wp)
{
return wp->w_width
+ wp->w_popup_padding[3] + wp->w_popup_border[3]
+ wp->w_popup_padding[1] + wp->w_popup_border[1];
}
/*
* Adjust the position and size of the popup to fit on the screen.
*/