mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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".
This commit is contained in:
19
src/beval.c
19
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;
|
||||
|
Reference in New Issue
Block a user