comparison src/gui_beval.c @ 640:8a5a95f7ef2a v7.0185

updated for version 7.0185
author vimboss
date Sun, 22 Jan 2006 23:30:12 +0000
parents 1c586ee8dd45
children 9090f866cd57
comparison
equal deleted inserted replaced
639:c79d4df4686e 640:8a5a95f7ef2a
26 int use_sandbox; 26 int use_sandbox;
27 linenr_T lnum; 27 linenr_T lnum;
28 char_u *text; 28 char_u *text;
29 static char_u *result = NULL; 29 static char_u *result = NULL;
30 long winnr = 0; 30 long winnr = 0;
31 #ifdef FEAT_WINDOWS
31 win_T *cw; 32 win_T *cw;
33 #endif
32 34
33 35
34 /* Don't do anything when 'ballooneval' is off, messages scrolled the 36 /* Don't do anything when 'ballooneval' is off, messages scrolled the
35 * windows up or we have no beval area. */ 37 * windows up or we have no beval area. */
36 if (!p_beval || balloonEval == NULL || msg_scrolled > 0) 38 if (!p_beval || balloonEval == NULL || msg_scrolled > 0)
38 40
39 #ifdef FEAT_EVAL 41 #ifdef FEAT_EVAL
40 if (*p_bexpr != NUL 42 if (*p_bexpr != NUL
41 && get_beval_info(balloonEval, TRUE, &wp, &lnum, &text, &col) == OK) 43 && get_beval_info(balloonEval, TRUE, &wp, &lnum, &text, &col) == OK)
42 { 44 {
45 # ifdef FEAT_WINDOWS
43 /* Convert window pointer to number. */ 46 /* Convert window pointer to number. */
44 for (cw = firstwin; cw != wp; cw = cw->w_next) 47 for (cw = firstwin; cw != wp; cw = cw->w_next)
45 ++winnr; 48 ++winnr;
49 # endif
46 50
47 set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum); 51 set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
48 set_vim_var_nr(VV_BEVAL_WINNR, winnr); 52 set_vim_var_nr(VV_BEVAL_WINNR, winnr);
49 set_vim_var_nr(VV_BEVAL_LNUM, (long)lnum); 53 set_vim_var_nr(VV_BEVAL_LNUM, (long)lnum);
50 set_vim_var_nr(VV_BEVAL_COL, (long)(col + 1)); 54 set_vim_var_nr(VV_BEVAL_COL, (long)(col + 1));
291 linenr_T lnum; 295 linenr_T lnum;
292 296
293 *textp = NULL; 297 *textp = NULL;
294 row = Y_2_ROW(beval->y); 298 row = Y_2_ROW(beval->y);
295 col = X_2_COL(beval->x); 299 col = X_2_COL(beval->x);
300 #ifdef FEAT_WINDOWS
296 wp = mouse_find_win(&row, &col); 301 wp = mouse_find_win(&row, &col);
302 #else
303 wp = firstwin;
304 #endif
297 if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp)) 305 if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
298 { 306 {
299 /* Found a window and the cursor is in the text. Now find the line 307 /* Found a window and the cursor is in the text. Now find the line
300 * number. */ 308 * number. */
301 if (!mouse_comp_pos(wp, &row, &col, &lnum)) 309 if (!mouse_comp_pos(wp, &row, &col, &lnum))