diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-07-09 23:22:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-07-09 23:22:15 +0200 |
commit | 7ba343e63483b09584d4bf5a997fc1d1c09f19f7 (patch) | |
tree | b37ff372b110b7648dfa3fe01fc35b3d62d8e01f /src/beval.c | |
parent | e089c3fd6937524a14d22baa7562b0820f1343ac (diff) | |
download | vim-git-7ba343e63483b09584d4bf5a997fc1d1c09f19f7.tar.gz |
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.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/beval.c b/src/beval.c index ef307c524..dc8966fe2 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; |