changeset 192:2fcd444c4bd3 v7.0057

updated for version 7.0057
author vimboss
date Mon, 07 Mar 2005 23:26:06 +0000
parents 2174ed5a186e
children eee3fa1b0197
files runtime/doc/todo.txt runtime/doc/version7.txt src/eval.c src/ex_cmds.c src/gui_beval.c src/proto/gui_beval.pro src/proto/misc1.pro src/proto/screen.pro
diffstat 8 files changed, 111 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Mar 06
+*todo.txt*      For Vim version 7.0aa.  Last change: 2005 Mar 07
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -35,14 +35,11 @@ be worked on, but only if you sponsor Vi
     Doesn't work: may send wrong escape sequence to terminal, because mouse
     type already changed when calling mch_setmouse(FALSE).
 
-Remove code for out-of-stack checks.
-Verify non-recursive regmatch() is OK with example from Michaelis.
-
 Mac unicode patch (Da Woon Jung):
 - selecting proportional font breaks display
-- UTF-8 text causes display problems.  Character width wrong?
+- UTF-8 text causes display problems.  Font replacement causes this.
 
-Patch for gettags(). Yegappan Lakshmanan Feb 27
+Patch for taglist() Yegappan Lakshmanan Feb 27
 - docs: use of ^ and $ in pattern, refer to |tag-regexp|
 	  explain what the fields mean.
 	  use of 'tags' option
@@ -58,9 +55,7 @@ autoload:
     helpfile doc/myscript.txt
   For the "helpfile" item ":helptags" is run.
 
-Patch for 'balloonexpr' option.  Sergey Khorev, Feb 26.  Addition Feb 27.
-
-Patch for "paranoid mode" by Kevin Collins, March 3.  Later updated.
+Patch for "paranoid mode" by Kevin Collins, March 7.  Needs more work.
 
 Awaiting response:
 -   Patch for mch_FullName() also in Vim 6.3?  os_mswin.c
@@ -70,9 +65,6 @@ Awaiting response:
 
 PLANNED FOR VERSION 7.0:
 
--   new DATA TYPES:
-	- None?  (or use empty string?)
-    See ~/vim/ideas.txt.
 -   Add SPELLCHECKER, with easy to add support for many languages.
     8   Add spell checking.  Use "ispell -a" somehow.
 	~/vim/patches/wm_vim-5_4d.zip  can be used as an example (includes
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Mar 06
+*version7.txt*  For Vim version 7.0aa.  Last change: 2005 Mar 07
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -23,6 +23,7 @@ KDE support				|new-KDE|
 Translated manual pages			|new-manpage-trans|
 Internal grep				|new-vimgrep|
 POSIX compatibility			|new-posix|
+Debugger support			|new-debug-support|
 Various new items			|new-items-7|
 
 IMPROVEMENTS				|improvements-7|
@@ -220,6 +221,14 @@ Items that were fixed for both Vi and PO
 - Implemented the 'prompt' option.
 
 
+Debugger support					*new-debug-support*
+----------------
+
+The 'balloonexpr' option has been added.  This is a generic way to implement
+balloon functionality.  You can use it to show info for the word under the
+mouse pointer.
+
+
 Various new items					*new-items-7*
 -----------------
 
@@ -927,4 +936,7 @@ unicodepdy[] as for UTF-8. (Taro Muraoka
 
 ":w fname" didn't work for files with 'buftype' set to "nofile".
 
+The method used to locate user commands for completion differed from when they
+are executed.  Abiguous command names were not completed properly.
+
  vim:tw=78:ts=8:ft=help:norl:
--- 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)
--- 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
      */
--- 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, 
 	    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, 
 			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;
 	    }
--- 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 : */
--- a/src/proto/misc1.pro
+++ b/src/proto/misc1.pro
@@ -87,7 +87,4 @@ void addfile __ARGS((garray_T *gap, char
 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 : */
--- 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));