Mercurial > vim
comparison src/beval.c @ 17316:8813e1626e0a v8.1.1657
patch 8.1.1657: Terminal: screen updates from 'balloonexpr' are not displayed
commit https://github.com/vim/vim/commit/7ba343e63483b09584d4bf5a997fc1d1c09f19f7
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 9 23:22:15 2019 +0200
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".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 09 Jul 2019 23:30:05 +0200 |
parents | 1b0b90f1d95e |
children | 6f15977fb40e |
comparison
equal
deleted
inserted
replaced
17315:f96f99faf747 | 17316:8813e1626e0a |
---|---|
25 int getword, | 25 int getword, |
26 int flags, // flags for find_ident_at_pos() | 26 int flags, // flags for find_ident_at_pos() |
27 win_T **winp, // can be NULL | 27 win_T **winp, // can be NULL |
28 linenr_T *lnump, // can be NULL | 28 linenr_T *lnump, // can be NULL |
29 char_u **textp, | 29 char_u **textp, |
30 int *colp) | 30 int *colp, // column where mouse hovers, can be NULL |
31 int *startcolp) // column where text starts, can be NULL | |
31 { | 32 { |
32 int row = mouserow; | 33 int row = mouserow; |
33 int col = mousecol; | 34 int col = mousecol; |
35 int scol; | |
34 win_T *wp; | 36 win_T *wp; |
35 char_u *lbuf; | 37 char_u *lbuf; |
36 linenr_T lnum; | 38 linenr_T lnum; |
37 | 39 |
38 *textp = NULL; | 40 *textp = NULL; |
96 } | 98 } |
97 else | 99 else |
98 { | 100 { |
99 // Find the word under the cursor. | 101 // Find the word under the cursor. |
100 ++emsg_off; | 102 ++emsg_off; |
101 len = find_ident_at_pos(wp, lnum, (colnr_T)col, &lbuf, | 103 len = find_ident_at_pos(wp, lnum, (colnr_T)col, |
102 flags); | 104 &lbuf, &scol, flags); |
103 --emsg_off; | 105 --emsg_off; |
104 if (len == 0) | 106 if (len == 0) |
105 return FAIL; | 107 return FAIL; |
106 lbuf = vim_strnsave(lbuf, len); | 108 lbuf = vim_strnsave(lbuf, len); |
107 } | 109 } |
110 if (winp != NULL) | 112 if (winp != NULL) |
111 *winp = wp; | 113 *winp = wp; |
112 if (lnump != NULL) | 114 if (lnump != NULL) |
113 *lnump = lnum; | 115 *lnump = lnum; |
114 *textp = lbuf; | 116 *textp = lbuf; |
115 *colp = col; | 117 if (colp != NULL) |
118 *colp = col; | |
119 if (startcolp != NULL) | |
120 *startcolp = scol; | |
116 return OK; | 121 return OK; |
117 } | 122 } |
118 } | 123 } |
119 } | 124 } |
120 return FAIL; | 125 return FAIL; |
148 col = X_2_COL(beval->x); | 153 col = X_2_COL(beval->x); |
149 } | 154 } |
150 #endif | 155 #endif |
151 if (find_word_under_cursor(row, col, getword, | 156 if (find_word_under_cursor(row, col, getword, |
152 FIND_IDENT + FIND_STRING + FIND_EVAL, | 157 FIND_IDENT + FIND_STRING + FIND_EVAL, |
153 winp, lnump, textp, colp) == OK) | 158 winp, lnump, textp, colp, NULL) == OK) |
154 { | 159 { |
155 #ifdef FEAT_VARTABS | 160 #ifdef FEAT_VARTABS |
156 vim_free(beval->vts); | 161 vim_free(beval->vts); |
157 beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array); | 162 beval->vts = tabstop_copy((*winp)->w_buffer->b_p_vts_array); |
158 if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL) | 163 if ((*winp)->w_buffer->b_p_vts_array != NULL && beval->vts == NULL) |
294 | 299 |
295 set_vim_var_string(VV_BEVAL_TEXT, NULL, -1); | 300 set_vim_var_string(VV_BEVAL_TEXT, NULL, -1); |
296 if (result != NULL && result[0] != NUL) | 301 if (result != NULL && result[0] != NUL) |
297 post_balloon(beval, result, NULL); | 302 post_balloon(beval, result, NULL); |
298 | 303 |
299 # ifdef FEAT_GUI | |
300 // The 'balloonexpr' evaluation may show something on the screen | 304 // The 'balloonexpr' evaluation may show something on the screen |
301 // that requires a screen update. | 305 // that requires a screen update. |
302 if (gui.in_use && must_redraw) | 306 if (must_redraw) |
303 redraw_after_callback(FALSE); | 307 redraw_after_callback(FALSE); |
304 # endif | |
305 | 308 |
306 recursive = FALSE; | 309 recursive = FALSE; |
307 return; | 310 return; |
308 } | 311 } |
309 } | 312 } |