summaryrefslogtreecommitdiffstats
path: root/src/beval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-07-09 23:22:15 +0200
committerBram Moolenaar <Bram@vim.org>2019-07-09 23:22:15 +0200
commit7ba343e63483b09584d4bf5a997fc1d1c09f19f7 (patch)
treeb37ff372b110b7648dfa3fe01fc35b3d62d8e01f /src/beval.c
parente089c3fd6937524a14d22baa7562b0820f1343ac (diff)
patch 8.1.1657: Terminal: screen updates from 'balloonexpr' are not displayedv8.1.1657
Problem: Terminal: screen updates from 'balloonexpr' are not displayed. Solution: Update the screen if needed. Fix the word position for "mousemoved".
Diffstat (limited to 'src/beval.c')
-rw-r--r--src/beval.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/beval.c b/src/beval.c
index ef307c5246..dc8966fe2f 100644
--- a/src/beval.c
+++ b/src/beval.c
@@ -27,10 +27,12 @@ find_word_under_cursor(
win_T **winp, // can be NULL
linenr_T *lnump, // can be NULL
char_u **textp,
- int *colp)
+ int *colp, // column where mouse hovers, can be NULL
+ int *startcolp) // column where text starts, can be NULL
{
int row = mouserow;
int col = mousecol;
+ int scol;
win_T *wp;
char_u *lbuf;
linenr_T lnum;
@@ -98,8 +100,8 @@ find_word_under_cursor(
{
// Find the word under the cursor.
++emsg_off;
- len = find_ident_at_pos(wp, lnum, (colnr_T)col, &lbuf,
- flags);
+ len = find_ident_at_pos(wp, lnum, (colnr_T)col,
+ &lbuf, &scol, flags);
--emsg_off;
if (len == 0)
return FAIL;
@@ -112,7 +114,10 @@ find_word_under_cursor(
if (lnump != NULL)
*lnump = lnum;
*textp = lbuf;
- *colp = col;
+ if (colp != NULL)
+ *colp = col;
+ if (startcolp != NULL)
+ *startcolp = scol;
return OK;
}
}
@@ -150,7 +155,7 @@ get_beval_info(
#endif
if (find_word_under_cursor(row, col, getword,
FIND_IDENT + FIND_STRING + FIND_EVAL,
- winp, lnump, textp, colp) == OK)
+ winp, lnump, textp, colp, NULL) == OK)
{
#ifdef FEAT_VARTABS
vim_free(beval->vts);
@@ -296,12 +301,10 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
if (result != NULL && result[0] != NUL)
post_balloon(beval, result, NULL);
-# ifdef FEAT_GUI
// The 'balloonexpr' evaluation may show something on the screen
// that requires a screen update.
- if (gui.in_use && must_redraw)
+ if (must_redraw)
redraw_after_callback(FALSE);
-# endif
recursive = FALSE;
return;