changeset 640:8a5a95f7ef2a v7.0185

updated for version 7.0185
author vimboss
date Sun, 22 Jan 2006 23:30:12 +0000
parents c79d4df4686e
children 6a944e0bd5d2
files runtime/doc/pattern.txt runtime/doc/spell.txt runtime/doc/todo.txt runtime/doc/version7.txt src/dosinst.c src/globals.h src/gui_beval.c src/main.c src/po/cleanup.vim src/syntax.c
diffstat 10 files changed, 93 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt*   For Vim version 7.0aa.  Last change: 2006 Jan 05
+*pattern.txt*   For Vim version 7.0aa.  Last change: 2006 Jan 22
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -394,7 +394,9 @@ More explanation and examples below, fol
 |/\ze|	\ze	\ze	anything, sets end of match
 |/\%^|	\%^	\%^	beginning of file |/zero-width|		*E71*
 |/\%$|	\%$	\%$	end of file |/zero-width|
+|/\%V|	\%V	\%V	inside Visual area |/zero-width|
 |/\%#|	\%#	\%#	cursor position |/zero-width|
+|/\%'m|	\%'m	\%'m	mark m position |/zero-width|
 |/\%l|	\%23l	\%23l	in line 23 |/zero-width|
 |/\%c|	\%23c	\%23c	in column 23 |/zero-width|
 |/\%v|	\%23v	\%23v	in virtual column 23 |/zero-width|
@@ -788,6 +790,11 @@ An ordinary atom can be:
 	position after the first "VIM".
 	Searching from the end of the file backwards is easier!
 
+						*/\%V*
+\%V	Match inside the Visual area.  When Visual mode has already been
+	stopped match in the area that |gv| would reselect.
+	Only works for the current buffer.
+
 						*/\%#* *cursor-position*
 \%#	Matches with the cursor position.  Only works when matching in a
 	buffer displayed in a window. {not in Vi}
@@ -802,6 +809,20 @@ An ordinary atom can be:
 <	When 'hlsearch' is set and you move the cursor around and make changes
 	this will clearly show when the match is updated or not.
 
+						*/\%'m* */\%<'m* */\%>'m*
+\%'m	Matches with the position of mark m.
+\%<'m	Matches before the position of mark m.
+\%>'m	Matches after the position of mark m.
+	Example, to highlight the text from mark 's to 'e: >
+		/.\%>'s.*\%<'e..
+<	Note that two dots are required to include mark 'e in the match.  That
+	is because "\%<'e" matches at the character before the 'e mark, and
+	since it's a |/zero-width| match it doesn't include that character.
+	{not in Vi}
+	WARNING: When the mark is moved after the pattern was used, the result
+	becomes invalid.  Vim doesn't automatically update the matches.
+	Similar to moving the cursor for |\%#|.
+
 						*/\%l* */\%>l* */\%<l*
 \%23l	Matches in a specific line.
 \%<23l	Matches above a specific line (lower line number).
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt*	For Vim version 7.0aa.  Last change: 2006 Jan 13
+*spell.txt*	For Vim version 7.0aa.  Last change: 2006 Jan 22
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -995,16 +995,11 @@ word to start with an upper case letter.
 WORDS WITH A SLASH					*spell-SLASH*
 
 The slash is used in the .dic file to separate the basic word from the affix
-letters that can be used.  Unfortunately, this means you cannot use a slash in
-a word.  Thus "TCP/IP" cannot be a word.  To work around that you can define a
-replacement character for the slash.  Example:
-
-	SLASH , ~
-
-Now you can use "TCP,IP" to add the word "TCP/IP".
-
-Of course, the letter used should itself not appear in any word!  The letter
-must be ASCII, thus a single byte.
+letters and other flags.  Unfortunately, this means you cannot use a slash in
+a word.  Thus "TCP/IP" is not a word but "TCP with the flags "IP".  To include
+a slash in the word put a backslash before it: "TCP\/IP".  In the rare case
+you want to use a backslash inside a word you need to use two backslashes.
+Any other use of the backslash is reserved for future expansion.
 
 
 KEEP-CASE WORDS						*spell-KEEPCASE*
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Jan 20
+*todo.txt*      For Vim version 7.0aa.  Last change: 2006 Jan 22
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -71,7 +71,6 @@ spelling:
 - Check out Hunspell 1.1.3.
     what does MAXNGRAMSUGS do?
     See announcement (Nemeth, 5 jan)
-    use "\/" instead of SLASH item?
     is COMPLEXPREFIXES necessary now that we have flags for affixes?
 - Look into hungarian dictionary:
   http://magyarispell.sourceforge.net/hu_HU-1.0.tar.gz
@@ -100,26 +99,6 @@ 8   Alternate Dutch word list at www.ned
   adding a bad word like "zw" would.  Use "zuw" to undo "zw"?  (Antonio
   Colombo)
 
-GTK: get an X error while exiting quickly after starting (running the tests).
-Caused by new GTK library?
-    X Error: BadWindow (invalid Window parameter) 3
-
-Support saving and restoring session for X windows?  It should work to do
-":mksession" and use "-S fname" for the restart command.  The
-gui_x11_wm_protocol_handler() already takes care of the rest.
-global_event_filter() for GTK.
-
-Is it easy to have an item in a pattern that matches with a mark location?
-Similar to |/\%>l| and |/\%c|.  (Benji Fisher)
-
-Win32 installer: Default _vimrc contains absolute path to diff.exe.  After
-upgrading it becomes invalid.  Fix it automatically somehow?  Use $VIMRUNTIME
-in the path instead of filling it the path?  At least give a clear error
-message.
-
-In diff mode deleting lines is very slow.  E.g., when diffing two .po files
-and then sourcing po/cleaup.vim.
-
 7   Add plugins for formatting.  Should be able to make a choice depending on
     the language of a file (English/Korean/Japanese/etc.).
     Setting the 'langformat' option to "chinese" would load the
@@ -139,8 +118,8 @@ Mac unicode patch (Da Woon Jung):
 Patch to add a few flags to search(). (Benji Fisher, Nov 29, doc update Dec 1)
 Also add search???() function that returns list with lnum and col.
 
-Win32: Use the free downloadable compiler 7.1.  Figure out how to do debugging
-(with Agide?) and describe it. (George Reilly)
+Win32: Use the free downloadable compiler 7.1 (2003).  Figure out how to do
+debugging (with Agide?) and describe it. (George Reilly)
 Try out using the free MS compiler and debugger, using Make_mvc.mak.
 Try using Visual C++ Express 2005. (Ilya Bobir Dec 20)
     Disadvantage: Annoying warning messages, requires ..._NO_DEPRECATE, this
@@ -1445,6 +1424,10 @@ 7   Add the arguments for configure to t
 7   When Vim detects a file is being edited elsewhere and it's a gvim session
     of the same user it should offer a "Raise" button, so that the other gvim
     window can be displayed. (Eduard)
+8   Support saving and restoring session for X windows?  It should work to do
+    ":mksession" and use "-S fname" for the restart command.  The
+    gui_x11_wm_protocol_handler() already takes care of the rest.
+    global_event_filter() for GTK.
 
 
 Spell checking:
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Jan 21
+*version7.txt*  For Vim version 7.0aa.  Last change: 2006 Jan 22
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -550,9 +550,15 @@ New items in search patterns: ~
 |/\%U| \%U1234abcd	search for character with 8 pos. hex number
 |/\]|  [\U1234abcd]	idem, in a colletion
 			    (The above partly by Ciaran McCreesh)
+
 |/[[=| [[=a=]]		an equivalence class (only for latin1 characters)
 |/[[.| [[.a.]]		a collation element (only works with single char)
 
+|/\%'m|  \%'m		match at mark m
+|/\%<'m| \%<'m		match before mark m
+|/\%>'m| \%>'m		match after mark m
+|/\%V|   \%V		match in Visual area
+
 Nesting |/multi| items no longer is an error when an empty match is possible.
 
 It is now possible to use \{0}, it matches the preceding atom zero times.  Not
@@ -1599,4 +1605,7 @@ the quickfix window to leave an unlisted
 Win32: when using two screens of different size, setting 'lines' to a large
 value didn't fill the whole screen. (SungHyun Nam)
 
+Win32 installer: The generated _vimrc contained an absolute path to diff.exe.
+After upgrading it becomes invalid.  Now use $VIMRUNTIME instead.
+
  vim:tw=78:ts=8:ft=help:norl:
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -1194,24 +1194,25 @@ install_vimrc(int idx)
 	fprintf(fd, "  if arg2 =~ ' ' | let arg2 = '\"' . arg2 . '\"' | endif\n");
 	fprintf(fd, "  let arg3 = v:fname_out\n");
 	fprintf(fd, "  if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
-	p = strchr(installdir, ' ');
-	if (p != NULL)
-	{
-	    /* The path has a space.  When using cmd.exe (Win NT/2000/XP) put
-	     * quotes around the whole command and around the diff command.
-	     * Otherwise put a double quote just before the space and at the
-	     * end of the command.  Putting quotes around the whole thing
-	     * doesn't work on Win 95/98/ME.  This is mostly guessed! */
-	    fprintf(fd, "  if &sh =~ '\\<cmd'\n");
-	    fprintf(fd, "    silent execute '!\"\"%s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '\"'\n", installdir);
-	    fprintf(fd, "  else\n");
-	    *p = NUL;
-	    fprintf(fd, "    silent execute '!%s\" %s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir, p + 1);
-	    *p = ' ';
-	    fprintf(fd, "  endif\n");
-	}
-	else
-	    fprintf(fd, "  silent execute '!%s\\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir);
+
+	/* If the path has a space:  When using cmd.exe (Win NT/2000/XP) put
+	 * quotes around the whole command and around the diff command.
+	 * Otherwise put a double quote just before the space and at the
+	 * end of the command.  Putting quotes around the whole thing
+	 * doesn't work on Win 95/98/ME.  This is mostly guessed! */
+	fprintf(fd, "  let eq = ''\n");
+	fprintf(fd, "  if $VIMRUNTIME =~ ' '\n");
+	fprintf(fd, "    if &sh =~ '\\<cmd'\n");
+	fprintf(fd, "      let cmd = '\"\"' . $VIMRUNTIME . '\\diff\"'\n");
+	fprintf(fd, "      let eq = '\"'\n");
+	fprintf(fd, "    else\n");
+	fprintf(fd, "      let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n");
+	fprintf(fd, "    endif\n");
+	fprintf(fd, "  else\n");
+	fprintf(fd, "    let cmd = $VIMRUNTIME . '\\diff'\n");
+	fprintf(fd, "  endif\n");
+	fprintf(fd, "  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq\n");
+
 	fprintf(fd, "endfunction\n");
 	fprintf(fd, "\n");
     }
--- a/src/globals.h
+++ b/src/globals.h
@@ -398,6 +398,7 @@ EXTERN int	drag_sep_line INIT(= FALSE);	
 #ifdef FEAT_DIFF
 /* Value set from 'diffopt'. */
 EXTERN int	diff_context INIT(= 6);	/* context for folds */
+EXTERN int	diff_need_scrollbind INIT(= FALSE);
 #endif
 
 #ifdef FEAT_MENU
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -28,7 +28,9 @@ general_beval_cb(beval, state)
     char_u	*text;
     static char_u  *result = NULL;
     long	winnr = 0;
+#ifdef FEAT_WINDOWS
     win_T	*cw;
+#endif
 
 
     /* Don't do anything when 'ballooneval' is off, messages scrolled the
@@ -40,9 +42,11 @@ general_beval_cb(beval, state)
     if (*p_bexpr != NUL
 	    && get_beval_info(balloonEval, TRUE, &wp, &lnum, &text, &col) == OK)
     {
+# ifdef FEAT_WINDOWS
 	/* Convert window pointer to number. */
 	for (cw = firstwin; cw != wp; cw = cw->w_next)
 	    ++winnr;
+# endif
 
 	set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
 	set_vim_var_nr(VV_BEVAL_WINNR, winnr);
@@ -293,7 +297,11 @@ get_beval_info(beval, getword, winp, lnu
     *textp = NULL;
     row = Y_2_ROW(beval->y);
     col = X_2_COL(beval->x);
+#ifdef FEAT_WINDOWS
     wp = mouse_find_win(&row, &col);
+#else
+    wp = firstwin;
+#endif
     if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
     {
 	/* Found a window and the cursor is in the text.  Now find the line
--- a/src/main.c
+++ b/src/main.c
@@ -988,6 +988,15 @@ main_loop(cmdwin, noexmode)
 	    skip_redraw = FALSE;
 	else if (do_redraw || stuff_empty())
 	{
+#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
+	    /* Scroll-binding for diff mode may have been postponed until
+	     * here.  Avoids doing it for every change. */
+	    if (diff_need_scrollbind)
+	    {
+		check_scrollbind((linenr_T)0, 0L);
+		diff_need_scrollbind = FALSE;
+	    }
+#endif
 #if defined(FEAT_FOLDING) && defined(FEAT_VISUAL)
 	    /* Include a closed fold completely in the Visual area. */
 	    foldAdjustVisual();
@@ -1153,9 +1162,14 @@ getout(exitval)
 	    buf->b_changedtick = -1;	/* note that we did it already */
 	    wp = firstwin;		/* restart, window may be closed */
 	}
+# ifdef FEAT_WINDOWS
 	else
 	    wp = wp->w_next;
+# else
+	break;
+# endif
     }
+
     /* Trigger BufUnload for buffers that are loaded */
     for (buf = firstbuf; buf != NULL; buf = buf->b_next)
 	if (buf->b_ml.ml_mfp != NULL)
--- a/src/po/cleanup.vim
+++ b/src/po/cleanup.vim
@@ -3,6 +3,7 @@
 " - Comment-out fuzzy and empty messages.
 " - Make sure there is a space before the string (required for Solaris).
 " Requires Vim 6.0 or later (because of multi-line search patterns).
+diffoff!
 silent g/^#: /d
 silent g/^#, fuzzy\(, .*\)\=\nmsgid ""\@!/.+1,/^$/-1s/^/#\~ /
 silent g/^msgstr"/s//msgstr "/
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2974,8 +2974,11 @@ syn_add_end_off(result, regmatch, spp, i
     else
     {
 	/* Don't go past the end of the line.  Matters for "rs=e+2" when there
-	 * is a matchgroup. */
-	len = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE));
+	 * is a matchgroup. Watch out for match with last NL in the buffer. */
+	if (result->lnum > syn_buf->b_ml.ml_line_count)
+	    len = 0;
+	else
+	    len = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE));
 	if (col > len)
 	    result->col = len;
 	else