changeset 795:86ce35c9750f v7.0231

updated for version 7.0231
author vimboss
date Tue, 21 Mar 2006 21:33:03 +0000
parents f19994020dad
children cc3902a09300
files runtime/doc/todo.txt runtime/doc/version7.txt src/eval.c src/gui_gtk_x11.c src/proto/misc2.pro
diffstat 5 files changed, 136 insertions(+), 17 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: 2006 Mar 20
+*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Mar 21
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -30,24 +30,12 @@ be worked on, but only if you sponsor Vi
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Links in docs to vimball docs.
-
 HTML indenting can be slow, find out why.
-Add a function to get the current time in usec.  reltime([start, [end]])
-    reltime().sec == seconds, reltime().usec = microseconds
-    reltime(start) current time relative to [start]
-	echo timestring(reltime(start), 3)  (3 is nr of digits after dot)
-    reltime(start, end) difference between start and end
-
-Include GetLatestVimScripts script?
 
 Adjust src/main.aap for installing manpages like in Makefile.
     And for generating Vim.app for the Mac.
     Install spell files with src/main.aap.
 
-Gnome2: When moving the toolbar out of the dock, so that it becomes floating,
-it can no longer be moved.
-
 Win32: Describe how to do debugging. (George Reilly)
 
 Mac unicode patch (Da Woon Jung, Eckehard Berns):
@@ -67,6 +55,8 @@ Add more tests for all new functionality
 Add text in user manual for using the undo tree.  Example with finding the
 text of a previous change.
 
+Links in docs to GetLatestVimScripts (getscript) plugin.
+
 
 Awaiting updated patches:
 8   Add ":n" to fnamemodify(): normalize path, remove "../" when possible.
@@ -239,6 +229,10 @@ 9   Can't paste a Visual selection from 
     when it is longer than 4000 characters.  Works OK from gvim to gvim and
     vim to vim.  Pasting through xterm (using the shift key) also works.
     It starts working after GTK gvim loses the selection and gains it again.
+-   Gnome2: When moving the toolbar out of the dock, so that it becomes
+    floating, it can no longer be moved.  Therefore making it float has been
+    blocked for now.
+
 
 Win32 GUI known bugs:
 -   Win32: tearoff menu window should have a scrollbar when it's taller than
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Mar 20
+*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Mar 21
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -175,6 +175,13 @@ wastes its time.
 In the Python interface vim.eval() also handles Dictionaries and Lists.
 |python-eval| (G. Sumner Hayes)
 
+The |getscript| plugin was added as a convenient way to update scripts from
+www.vim.org automatically. (Charles Campbell)
+
+The |vimball| plugin was added as a convenient way to distribute a set of
+files for a plugin (plugin file, autoload script, documentation). (Charles
+Campbell)
+
 
 Spell checking						*new-spell*
 --------------
@@ -721,6 +728,8 @@ New and extended functions: ~
 |mkdir()|		create a directory
 |printf()|		format text
 |readfile()|		read a file into a list of lines
+|reltime()|		get time value, possibly relative
+|reltimestr()|		turn a time value into a string
 |remove()|		remove one or more items from a List or Dictionary
 |repeat()| 		repeat "expr" "count" times (Christophe Poucet)
 |reverse()|		reverse the order of a List
@@ -1255,6 +1264,9 @@ Also create a vimtutor.bat batch file.
 
 The 'balloonexpr' option is now |global-local|.
 
+The system() function now runs in cooked mode, thus can be interrupted by
+CTRL-C.
+
 ==============================================================================
 COMPILE TIME CHANGES					*compile-changes-7*
 
--- a/src/eval.c
+++ b/src/eval.c
@@ -583,6 +583,8 @@ static void f_printf __ARGS((typval_T *a
 static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_range __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_readfile __ARGS((typval_T *argvars, typval_T *rettv));
+static void f_reltime __ARGS((typval_T *argvars, typval_T *rettv));
+static void f_reltimestr __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_remote_expr __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_remote_foreground __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_remote_peek __ARGS((typval_T *argvars, typval_T *rettv));
@@ -7032,6 +7034,8 @@ static struct fst
     {"pumvisible",	0, 0, f_pumvisible},
     {"range",		1, 3, f_range},
     {"readfile",	1, 3, f_readfile},
+    {"reltime",		0, 2, f_reltime},
+    {"reltimestr",	1, 1, f_reltimestr},
     {"remote_expr",	2, 3, f_remote_expr},
     {"remote_foreground", 1, 1, f_remote_foreground},
     {"remote_peek",	1, 2, f_remote_peek},
@@ -8982,7 +8986,8 @@ findfilendir(argvars, rettv, dir)
 	    vim_free(fresult);
 	    fresult = find_file_in_path_option(first ? fname : NULL,
 					       first ? (int)STRLEN(fname) : 0,
-					       0, first, path, dir, NULL);
+					0, first, path, dir, NULL,
+					dir ? (char_u *)"" : curbuf->b_p_sua);
 	    first = FALSE;
 	} while (--count > 0 && fresult != NULL);
     }
@@ -10598,6 +10603,9 @@ f_has(argvars, rettv)
 #ifdef FEAT_PROFILE
 	"profile",
 #endif
+#ifdef FEAT_RELTIME
+	"reltime",
+#endif
 #ifdef FEAT_QUICKFIX
 	"quickfix",
 #endif
@@ -12635,6 +12643,104 @@ f_readfile(argvars, rettv)
     fclose(fd);
 }
 
+#if defined(FEAT_RELTIME)
+static int list2proftime __ARGS((typval_T *arg, proftime_T *tm));
+
+/*
+ * Convert a List to proftime_T.
+ * Return FAIL when there is something wrong.
+ */
+    static int
+list2proftime(arg, tm)
+    typval_T	*arg;
+    proftime_T  *tm;
+{
+    long	n1, n2;
+    int	error = FALSE;
+
+    if (arg->v_type != VAR_LIST || arg->vval.v_list == NULL
+					     || arg->vval.v_list->lv_len != 2)
+	return FAIL;
+    n1 = list_find_nr(arg->vval.v_list, 0L, &error);
+    n2 = list_find_nr(arg->vval.v_list, 1L, &error);
+# ifdef WIN3264
+    tm->QuadPart = (n1 << 32) + n2;
+# else
+    tm->tv_sec = n1;
+    tm->tv_usec = n2;
+# endif
+    return error ? FAIL : OK;
+}
+#endif /* FEAT_RELTIME */
+
+/*
+ * "reltime()" function
+ */
+    static void
+f_reltime(argvars, rettv)
+    typval_T	*argvars;
+    typval_T	*rettv;
+{
+#ifdef FEAT_RELTIME
+    proftime_T	res;
+    proftime_T	start;
+
+    if (argvars[0].v_type == VAR_UNKNOWN)
+    {
+	/* No arguments: get current time. */
+	profile_start(&res);
+    }
+    else if (argvars[1].v_type == VAR_UNKNOWN)
+    {
+	if (list2proftime(&argvars[0], &res) == FAIL)
+	    return;
+	profile_end(&res);
+    }
+    else
+    {
+	/* Two arguments: compute the difference. */
+	if (list2proftime(&argvars[0], &start) == FAIL
+		|| list2proftime(&argvars[1], &res) == FAIL)
+	    return;
+	profile_sub(&res, &start);
+    }
+
+    if (rettv_list_alloc(rettv) == OK)
+    {
+	long	n1, n2;
+
+# ifdef WIN3264
+	n1 = res.QuadPart >> 32;
+	n2 = res.QuadPart & 0xffffffff;
+# else
+	n1 = res.tv_sec;
+	n2 = res.tv_usec;
+# endif
+	list_append_number(rettv->vval.v_list, (varnumber_T)n1);
+	list_append_number(rettv->vval.v_list, (varnumber_T)n2);
+    }
+#endif
+}
+
+/*
+ * "reltimestr()" function
+ */
+    static void
+f_reltimestr(argvars, rettv)
+    typval_T	*argvars;
+    typval_T	*rettv;
+{
+#ifdef FEAT_RELTIME
+    proftime_T	tm;
+#endif
+
+    rettv->v_type = VAR_STRING;
+    rettv->vval.v_string = NULL;
+#ifdef FEAT_RELTIME
+    if (list2proftime(&argvars[0], &tm) == OK)
+	rettv->vval.v_string = vim_strsave((char_u *)profile_msg(&tm));
+#endif
+}
 
 #if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11)
 static void make_connection __ARGS((void));
@@ -15098,7 +15204,8 @@ f_system(argvars, rettv)
 	}
     }
 
-    res = get_cmd_output(get_tv_string(&argvars[0]), infile, SHELL_SILENT);
+    res = get_cmd_output(get_tv_string(&argvars[0]), infile,
+						 SHELL_SILENT | SHELL_COOKED);
 
 #ifdef USE_CR
     /* translate <CR> into <NL> */
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -3541,6 +3541,8 @@ gui_mch_init(void)
 	gnome_app_set_menus(GNOME_APP(gui.mainwin), GTK_MENU_BAR(gui.menubar));
 	dockitem = gnome_app_get_dock_item_by_name(GNOME_APP(gui.mainwin),
 						   GNOME_APP_MENUBAR_NAME);
+	// bonobo_dock_item_set_behavior(dockitem,
+	//				 BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING);
 	gui.menubar_h = GTK_WIDGET(dockitem);
 #  else
 	gui.menubar_h = gnome_dock_item_new("VimMainMenu",
@@ -3597,6 +3599,10 @@ gui_mch_init(void)
 	dockitem = gnome_app_get_dock_item_by_name(GNOME_APP(gui.mainwin),
 						   GNOME_APP_TOOLBAR_NAME);
 	gui.toolbar_h = GTK_WIDGET(dockitem);
+	/* When the toolbar is floating it gets stuck.  So long as that isn't
+	 * fixed let's disallow floating.  Also changes it appearance... */
+	bonobo_dock_item_set_behavior(dockitem,
+					 BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING);
 	gtk_container_set_border_width(GTK_CONTAINER(gui.toolbar), 0);
 #  else
 	GtkWidget *dockitem;
--- a/src/proto/misc2.pro
+++ b/src/proto/misc2.pro
@@ -88,7 +88,7 @@ char_u *vim_findfile __ARGS((void *searc
 void vim_findfile_free_visited __ARGS((void *search_ctx));
 char_u *find_file_in_path __ARGS((char_u *ptr, int len, int options, int first, char_u *rel_fname));
 char_u *find_directory_in_path __ARGS((char_u *ptr, int len, int options, char_u *rel_fname));
-char_u *find_file_in_path_option __ARGS((char_u *ptr, int len, int options, int first, char_u *path_option, int need_dir, char_u *rel_fname));
+char_u *find_file_in_path_option __ARGS((char_u *ptr, int len, int options, int first, char_u *path_option, int need_dir, char_u *rel_fname, char_u *suffixes));
 int vim_chdir __ARGS((char_u *new_dir));
 int get_user_name __ARGS((char_u *buf, int len));
 void sort_strings __ARGS((char_u **files, int count));