patch 8.1.1657: Terminal: screen updates from 'balloonexpr' are not displayed
Problem: Terminal: screen updates from 'balloonexpr' are not displayed.
Solution: Update the screen if needed. Fix the word position for
"mousemoved".
diff --git a/src/beval.c b/src/beval.c
index ef307c5..dc8966f 100644
--- a/src/beval.c
+++ b/src/beval.c
@@ -27,10 +27,12 @@
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 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 @@
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 @@
#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 @@
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;