summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-10 21:55:54 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-10 21:55:54 +0200
commitb05caa782dbab51db8de60940eff7992f8cfd882 (patch)
treea209cf4819bd8aad2182aa01955110f8ca2fe899 /src
parent3b849af90a691f2a9999222b0e69bd161bebc5e2 (diff)
patch 8.1.1659: popup window "mousemoved" values not correctv8.1.1659
Problem: Popup window "mousemoved" values not correct. Solution: Convert text column to mouse column.
Diffstat (limited to 'src')
-rw-r--r--src/popupwin.c16
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 3 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index c6355e122a..f2b31300f0 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -184,14 +184,24 @@ set_mousemoved_values(win_T *wp)
static void
set_mousemoved_columns(win_T *wp, int flags)
{
+ win_T *textwp;
char_u *text;
int col;
+ pos_T pos;
+ colnr_T mcol;
if (find_word_under_cursor(mouse_row, mouse_col, TRUE, flags,
- NULL, NULL, &text, NULL, &col) == OK)
+ &textwp, &pos.lnum, &text, NULL, &col) == OK)
{
- wp->w_popup_mouse_mincol = col;
- wp->w_popup_mouse_maxcol = col + STRLEN(text) - 1;
+ // convert text column to mouse column
+ pos.col = col;
+ pos.coladd = 0;
+ getvcol(textwp, &pos, &mcol, NULL, NULL);
+ wp->w_popup_mouse_mincol = mcol;
+
+ pos.col = col + STRLEN(text) - 1;
+ getvcol(textwp, &pos, NULL, NULL, &mcol);
+ wp->w_popup_mouse_maxcol = mcol;
vim_free(text);
}
}
diff --git a/src/version.c b/src/version.c
index 5cede94f95..5e83159edf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1659,
+/**/
1658,
/**/
1657,