diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-03-07 23:26:06 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-03-07 23:26:06 +0000 |
commit | e2ac10d732fae811411129ff5f101fab72ac1248 (patch) | |
tree | c7f76f50745760ca7add7c0960c1fb94c565202c /src | |
parent | 4d34b432dbff61a435816d74ef6b08a1b50d3f8d (diff) | |
download | vim-e2ac10d732fae811411129ff5f101fab72ac1248.zip |
updated for version 7.0057
Diffstat (limited to 'src')
-rw-r--r-- | src/eval.c | 7 | ||||
-rw-r--r-- | src/ex_cmds.c | 29 | ||||
-rw-r--r-- | src/gui_beval.c | 95 | ||||
-rw-r--r-- | src/proto/gui_beval.pro | 17 | ||||
-rw-r--r-- | src/proto/misc1.pro | 3 | ||||
-rw-r--r-- | src/proto/screen.pro | 1 |
6 files changed, 94 insertions, 58 deletions
diff --git a/src/eval.c b/src/eval.c index c7aba5145..da2015f31 100644 --- a/src/eval.c +++ b/src/eval.c @@ -318,6 +318,11 @@ static struct vimvar {VV_NAME("profiling", VAR_NUMBER), VV_RO}, {VV_NAME("fcs_reason", VAR_STRING), VV_RO}, {VV_NAME("fcs_choice", VAR_STRING), 0}, + {VV_NAME("beval_bufnr", VAR_NUMBER), VV_RO}, + {VV_NAME("beval_winnr", VAR_NUMBER), VV_RO}, + {VV_NAME("beval_lnum", VAR_NUMBER), VV_RO}, + {VV_NAME("beval_col", VAR_NUMBER), VV_RO}, + {VV_NAME("beval_text", VAR_STRING), VV_RO}, }; /* shorthand */ @@ -13138,7 +13143,7 @@ done: } /* - * "gettags()" function + * "taglist()" function */ static void f_taglist(argvars, rettv) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 0a6488061..2e58851d5 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -4663,28 +4663,6 @@ ex_global(eap) return; } -#if 0 -#ifdef HAVE_SETJMP_H - /* - * Matching with a regexp may cause a very deep recursive call of - * regmatch(). Vim will crash when running out of stack space. - * Catch this here if the system supports it. - * It's a bit slow, thus do it outside of the loop. - */ - mch_startjmp(); - if (SETJMP(lc_jump_env) != 0) - { - mch_didjmp(); -# ifdef SIGHASARG - if (lc_signal != SIGINT) -# endif - EMSG(_(e_complex)); - got_int = TRUE; - goto jumpend; - } -#endif -#endif - /* * pass 1: set marks for each (not) matching line */ @@ -4700,13 +4678,6 @@ ex_global(eap) line_breakcheck(); } -#if 0 -#ifdef HAVE_SETJMP_H -jumpend: - mch_endjmp(); -#endif -#endif - /* * pass 2: execute the command for each line that has been marked */ diff --git a/src/gui_beval.c b/src/gui_beval.c index 0f08649f6..1b69af624 100644 --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -12,7 +12,68 @@ #if defined(FEAT_BEVAL) || defined(PROTO) -/* on Win32 only gui_mch_get_beval_info is required */ +/* + * Common code, invoked when the mouse is resting for a moment. + */ +/*ARGSUSED*/ + void +general_beval_cb(beval, state) + BalloonEval *beval; + int state; +{ + win_T *wp; + int col; + linenr_T lnum; + char_u *text; + static char_u *result = NULL; + long winnr = 0; + win_T *cw; + + + /* Don't do anything when 'ballooneval' is off, messages scrolled the + * windows up or we have no beval area. */ + if (!p_beval || balloonEval == NULL || msg_scrolled > 0) + return; + +#ifdef FEAT_EVAL + if (*p_bexpr != NUL + && get_beval_info(balloonEval, TRUE, &wp, &lnum, &text, &col) == OK) + { + /* Convert window pointer to number. */ + for (cw = firstwin; cw != wp; cw = cw->w_next) + ++winnr; + + set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum); + set_vim_var_nr(VV_BEVAL_WINNR, winnr); + set_vim_var_nr(VV_BEVAL_LNUM, (long)lnum); + set_vim_var_nr(VV_BEVAL_COL, (long)(col + 1)); + set_vim_var_string(VV_BEVAL_TEXT, text, -1); + vim_free(text); + + ++sandbox; + vim_free(result); + result = eval_to_string(p_bexpr, NULL); + --sandbox; + + set_vim_var_string(VV_BEVAL_TEXT, NULL, -1); + if (result != NULL && result[0] != NUL) + { + gui_mch_post_balloon(beval, result); + return; + } + } +#endif +#ifdef FEAT_NETBEANS_INTG + if (bevalServers & BEVAL_NETBEANS) + netbeans_beval_cb(beval, state); +#endif +#ifdef FEAT_SUN_WORKSHOP + if (bevalServers & BEVAL_WORKSHOP) + workshop_beval_cb(beval, state); +#endif +} + +/* on Win32 only get_beval_info() is required */ #if !defined(FEAT_GUI_W32) || defined(PROTO) #ifdef FEAT_GUI_GTK @@ -199,26 +260,29 @@ gui_mch_currently_showing_beval() #endif #endif /* !FEAT_GUI_W32 */ -#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) || defined(PROTO) +#if defined(FEAT_SUN_WORKSHOP) || defined(FEAT_NETBEANS_INTG) \ + || defined(FEAT_EVAL) || defined(PROTO) /* * Get the text and position to be evaluated for "beval". - * When "usingNetbeans" is set the returned text is in allocated memory. + * If "getword" is true the returned text is not the whole line but the + * relevant word in allocated memory. * Returns OK or FAIL. */ int -gui_mch_get_beval_info(beval, filename, line, text, idx) +get_beval_info(beval, getword, winp, lnump, textp, colp) BalloonEval *beval; - char_u **filename; - int *line; - char_u **text; - int *idx; + int getword; + win_T **winp; + linenr_T *lnump; + char_u **textp; + int *colp; { win_T *wp; int row, col; char_u *lbuf; linenr_T lnum; - *text = NULL; + *textp = NULL; row = Y_2_ROW(beval->y); col = X_2_COL(beval->x); wp = mouse_find_win(&row, &col); @@ -233,8 +297,7 @@ gui_mch_get_beval_info(beval, filename, line, text, idx) if (col <= win_linetabsize(wp, lbuf, (colnr_T)MAXCOL)) { /* Not past end of line. */ -# ifdef FEAT_NETBEANS_INTG - if (usingNetbeans) + if (getword) { /* For Netbeans we get the relevant part of the line * instead of the whole line. */ @@ -290,11 +353,11 @@ gui_mch_get_beval_info(beval, filename, line, text, idx) lbuf = vim_strnsave(lbuf, len); } } -# endif - *filename = wp->w_buffer->b_ffname; - *line = (int)lnum; - *text = lbuf; - *idx = col; + + *winp = wp; + *lnump = lnum; + *textp = lbuf; + *colp = col; beval->ts = wp->w_buffer->b_p_ts; return OK; } diff --git a/src/proto/gui_beval.pro b/src/proto/gui_beval.pro index 160b0e1bd..42e0082f9 100644 --- a/src/proto/gui_beval.pro +++ b/src/proto/gui_beval.pro @@ -1,10 +1,11 @@ /* gui_beval.c */ -BalloonEval *gui_mch_create_beval_area __ARGS((void *target, char_u *mesg, void (*mesgCB)(BalloonEval *, int), void *clientData)); -void gui_mch_destroy_beval_area __ARGS((BalloonEval *beval)); -void gui_mch_enable_beval_area __ARGS((BalloonEval *beval)); -void gui_mch_disable_beval_area __ARGS((BalloonEval *beval)); -BalloonEval *gui_mch_currently_showing_beval __ARGS((void)); -int gui_mch_get_beval_info __ARGS((BalloonEval *beval, char_u **filename, int *line, char_u **text, int *idx)); -void gui_mch_post_balloon __ARGS((BalloonEval *beval, char_u *mesg)); -void gui_mch_unpost_balloon __ARGS((BalloonEval *beval)); +extern void general_beval_cb __ARGS((BalloonEval *beval, int state)); +extern BalloonEval *gui_mch_create_beval_area __ARGS((void *target, char_u *mesg, void (*mesgCB)(BalloonEval *, int), void *clientData)); +extern void gui_mch_destroy_beval_area __ARGS((BalloonEval *beval)); +extern void gui_mch_enable_beval_area __ARGS((BalloonEval *beval)); +extern void gui_mch_disable_beval_area __ARGS((BalloonEval *beval)); +extern BalloonEval *gui_mch_currently_showing_beval __ARGS((void)); +extern int get_beval_info __ARGS((BalloonEval *beval, int getword, win_T **winp, linenr_T *lnump, char_u **textp, int *colp)); +extern void gui_mch_post_balloon __ARGS((BalloonEval *beval, char_u *mesg)); +extern void gui_mch_unpost_balloon __ARGS((BalloonEval *beval)); /* vim: set ft=c : */ diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index e98fd0bec..5a42c13d1 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -87,7 +87,4 @@ void addfile __ARGS((garray_T *gap, char_u *f, int flags)); char_u *get_cmd_output __ARGS((char_u *cmd, char_u *infile, int flags)); void FreeWild __ARGS((int count, char_u **files)); int goto_im __ARGS((void)); -void mch_startjmp __ARGS((void)); -void mch_endjmp __ARGS((void)); -void mch_didjmp __ARGS((void)); /* vim: set ft=c : */ diff --git a/src/proto/screen.pro b/src/proto/screen.pro index 6c83bf274..6831d42b9 100644 --- a/src/proto/screen.pro +++ b/src/proto/screen.pro @@ -32,7 +32,6 @@ void screenalloc __ARGS((int clear)); void screenclear __ARGS((void)); int can_clear __ARGS((char_u *p)); void screen_start __ARGS((void)); -void screen_down __ARGS((void)); void windgoto __ARGS((int row, int col)); void setcursor __ARGS((void)); int win_ins_lines __ARGS((win_T *wp, int row, int line_count, int invalid, int mayclear)); |