--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.285
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.285 (after 7.2.169)
+Problem: CTRL-U in Insert mode also deletes indent. (Andrey Voropaev)
+Solution: Fix mistake made in patch 7.2.169.
+Files: src/edit.c
+
+
+*** ../vim-7.2.284/src/edit.c 2009-07-09 18:15:19.000000000 +0200
+--- src/edit.c 2009-11-05 20:25:15.000000000 +0100
+***************
+*** 8519,8525 ****
+ {
+ save_col = curwin->w_cursor.col;
+ beginline(BL_WHITE);
+! if (curwin->w_cursor.col < (colnr_T)temp)
+ mincol = curwin->w_cursor.col;
+ curwin->w_cursor.col = save_col;
+ }
+--- 8519,8525 ----
+ {
+ save_col = curwin->w_cursor.col;
+ beginline(BL_WHITE);
+! if (curwin->w_cursor.col < save_col)
+ mincol = curwin->w_cursor.col;
+ curwin->w_cursor.col = save_col;
+ }
+*** ../vim-7.2.284/src/version.c 2009-11-03 18:46:53.000000000 +0100
+--- src/version.c 2009-11-11 13:21:25.000000000 +0100
+***************
+*** 678,679 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 285,
+ /**/
+
+--
+(letter from Mark to Mike, about the film's probable certificate)
+ I would like to get back to the Censor and agree to lose the shits, take
+ the odd Jesus Christ out and lose Oh fuck off, but to retain 'fart in
+ your general direction', 'castanets of your testicles' and 'oral sex'
+ and ask him for an 'A' rating on that basis.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.286
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.286 (after 7.2.269)
+Problem: The "--startuptime=<file>" argument is not consistent with other
+ arguments.
+Solution: Use "--startuptime <file>". Added the +startuptime feature.
+Files: runtime/doc/eval.txt, runtime/doc/starting.txt,
+ runtime/doc/various.txt, src/eval.c, src/main.c, src/version.c
+
+
+*** ../vim-7.2.285/runtime/doc/eval.txt 2009-04-22 12:53:31.000000000 +0200
+--- runtime/doc/eval.txt 2009-11-11 13:01:58.000000000 +0100
+***************
+*** 5869,5874 ****
+--- 5881,5887 ----
+ signs Compiled with |:sign| support.
+ smartindent Compiled with 'smartindent' support.
+ sniff Compiled with SNiFF interface support.
++ startuptime Compiled with |--startuptime| support.
+ statusline Compiled with support for 'statusline', 'rulerformat'
+ and special formats of 'titlestring' and 'iconstring'.
+ sun_workshop Compiled with support for Sun |workshop|.
+*** ../vim-7.2.285/runtime/doc/starting.txt 2009-11-03 12:10:39.000000000 +0100
+--- runtime/doc/starting.txt 2009-11-11 13:20:56.000000000 +0100
+***************
+*** 144,155 ****
+ -u NORC no yes
+ --noplugin yes no
+
+! --startuptime={fname} *--startuptime*
+ During startup write timing messages to the file {fname}.
+ This can be used to find out where time is spent while loading
+! your .vimrc and plugins.
+ When {fname} already exists new messages are appended.
+! {only when compiled with this feature}
+
+ *--literal*
+ --literal Take file names literally, don't expand wildcards. Not needed
+--- 144,156 ----
+ -u NORC no yes
+ --noplugin yes no
+
+! --startuptime {fname} *--startuptime*
+ During startup write timing messages to the file {fname}.
+ This can be used to find out where time is spent while loading
+! your .vimrc, plugins and opening the first file.
+ When {fname} already exists new messages are appended.
+! (Only available when compiled with the |+startuptime|
+! feature).
+
+ *--literal*
+ --literal Take file names literally, don't expand wildcards. Not needed
+*** ../vim-7.2.285/runtime/doc/various.txt 2009-07-09 15:55:34.000000000 +0200
+--- runtime/doc/various.txt 2009-11-11 13:03:52.000000000 +0100
+***************
+*** 374,379 ****
+--- 374,380 ----
+ B *+signs* |:sign|
+ N *+smartindent* |'smartindent'|
+ m *+sniff* SniFF interface |sniff|
++ N *+startuptime* |--startuptime| argument
+ N *+statusline* Options 'statusline', 'rulerformat' and special
+ formats of 'titlestring' and 'iconstring'
+ m *+sun_workshop* |workshop|
+*** ../vim-7.2.285/src/eval.c 2009-11-03 14:26:29.000000000 +0100
+--- src/eval.c 2009-11-11 12:59:53.000000000 +0100
+***************
+*** 11736,11741 ****
+--- 11736,11744 ----
+ #ifdef FEAT_SNIFF
+ "sniff",
+ #endif
++ #ifdef STARTUPTIME
++ "startuptime",
++ #endif
+ #ifdef FEAT_STL_OPT
+ "statusline",
+ #endif
+*** ../vim-7.2.285/src/main.c 2009-11-03 12:10:39.000000000 +0100
+--- src/main.c 2009-11-08 12:57:46.000000000 +0100
+***************
+*** 204,212 ****
+ #ifdef STARTUPTIME
+ for (i = 1; i < argc; ++i)
+ {
+! if (STRNICMP(argv[i], "--startuptime=", 14) == 0)
+ {
+! time_fd = mch_fopen(argv[i] + 14, "a");
+ TIME_MSG("--- VIM STARTING ---");
+ break;
+ }
+--- 204,212 ----
+ #ifdef STARTUPTIME
+ for (i = 1; i < argc; ++i)
+ {
+! if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc)
+ {
+! time_fd = mch_fopen(argv[i + 1], "a");
+ TIME_MSG("--- VIM STARTING ---");
+ break;
+ }
+***************
+*** 1726,1731 ****
+--- 1726,1736 ----
+ want_argument = TRUE;
+ argv_idx += 3;
+ }
++ else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
++ {
++ want_argument = TRUE;
++ argv_idx += 11;
++ }
+ #ifdef FEAT_CLIENTSERVER
+ else if (STRNICMP(argv[0] + argv_idx, "serverlist", 10) == 0)
+ ; /* already processed -- no arg */
+***************
+*** 1761,1770 ****
+ /* already processed, skip */
+ }
+ #endif
+- else if (STRNICMP(argv[0] + argv_idx, "startuptime", 11) == 0)
+- {
+- /* already processed, skip */
+- }
+ else
+ {
+ if (argv[0][argv_idx])
+--- 1766,1771 ----
+***************
+*** 2061,2067 ****
+ mainerr(ME_GARBAGE, (char_u *)argv[0]);
+
+ --argc;
+! if (argc < 1 && c != 'S')
+ mainerr_arg_missing((char_u *)argv[0]);
+ ++argv;
+ argv_idx = -1;
+--- 2062,2068 ----
+ mainerr(ME_GARBAGE, (char_u *)argv[0]);
+
+ --argc;
+! if (argc < 1 && c != 'S') /* -S has an optional argument */
+ mainerr_arg_missing((char_u *)argv[0]);
+ ++argv;
+ argv_idx = -1;
+***************
+*** 2102,2112 ****
+ (char_u *)argv[0];
+ break;
+
+! case '-': /* "--cmd {command}" execute command */
+! if (parmp->n_pre_commands >= MAX_ARG_CMDS)
+! mainerr(ME_EXTRA_CMD, NULL);
+! parmp->pre_commands[parmp->n_pre_commands++] =
+ (char_u *)argv[0];
+ break;
+
+ /* case 'd': -d {device} is handled in mch_check_win() for the
+--- 2103,2118 ----
+ (char_u *)argv[0];
+ break;
+
+! case '-':
+! if (argv[-1][2] == 'c')
+! {
+! /* "--cmd {command}" execute command */
+! if (parmp->n_pre_commands >= MAX_ARG_CMDS)
+! mainerr(ME_EXTRA_CMD, NULL);
+! parmp->pre_commands[parmp->n_pre_commands++] =
+ (char_u *)argv[0];
++ }
++ /* "--startuptime <file>" already handled */
+ break;
+
+ /* case 'd': -d {device} is handled in mch_check_win() for the
+***************
+*** 3144,3149 ****
+--- 3150,3158 ----
+ main_msg(_("--serverlist\t\tList available Vim server names and exit"));
+ main_msg(_("--servername <name>\tSend to/become the Vim server <name>"));
+ #endif
++ #ifdef STARTUPTIME
++ main_msg(_("--startuptime=<file>\tWrite startup timing messages to <file>"));
++ #endif
+ #ifdef FEAT_VIMINFO
+ main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
+ #endif
+*** ../vim-7.2.285/src/version.c 2009-11-11 13:22:09.000000000 +0100
+--- src/version.c 2009-11-11 14:17:28.000000000 +0100
+***************
+*** 494,499 ****
+--- 494,504 ----
+ #else
+ "-sniff",
+ #endif
++ #ifdef STARTUPTIME
++ "+startuptime",
++ #else
++ "-startuptime",
++ #endif
+ #ifdef FEAT_STL_OPT
+ "+statusline",
+ #else
+*** ../vim-7.2.285/src/version.c 2009-11-11 13:22:09.000000000 +0100
+--- src/version.c 2009-11-11 14:17:28.000000000 +0100
+***************
+*** 678,679 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 286,
+ /**/
+
+--
+A fool must search for a greater fool to find admiration.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.287
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.287
+Problem: Warning from gcc 3.4 about uninitialized variable.
+Solution: Move assignment outside of #ifdef.
+Files: src/if_perl.xs
+
+
+*** ../vim-7.2.286/src/if_perl.xs 2009-07-14 16:05:14.000000000 +0200
+--- src/if_perl.xs 2009-11-11 12:29:32.000000000 +0100
+***************
+*** 720,727 ****
+ #ifdef HAVE_SANDBOX
+ if (sandbox)
+ {
+ # ifndef MAKE_TEST /* avoid a warning for unreachable code */
+! if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe))
+ EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
+ else
+ # endif
+--- 720,728 ----
+ #ifdef HAVE_SANDBOX
+ if (sandbox)
+ {
++ safe = perl_get_sv( "VIM::safe", FALSE );
+ # ifndef MAKE_TEST /* avoid a warning for unreachable code */
+! if (safe == NULL || !SvTRUE(safe))
+ EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
+ else
+ # endif
+*** ../vim-7.2.286/src/version.c 2009-11-11 14:21:48.000000000 +0100
+--- src/version.c 2009-11-11 14:44:49.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 287,
+ /**/
+
+--
+The most powerful force in the universe is gossip.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.288
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.288
+Problem: Python 2.6 pyconfig.h redefines macros.
+Solution: Undefine the macros before including pyconfig.h.
+Files: src/if_python.c
+
+
+*** ../vim-7.2.287/src/if_python.c 2009-11-03 11:43:05.000000000 +0100
+--- src/if_python.c 2009-11-11 12:33:37.000000000 +0100
+***************
+*** 37,42 ****
+--- 37,48 ----
+ #ifdef HAVE_STDARG_H
+ # undef HAVE_STDARG_H /* Python's config.h defines it as well. */
+ #endif
++ #ifdef _POSIX_C_SOURCE
++ # undef _POSIX_C_SOURCE /* pyconfig.h defines it as well. */
++ #endif
++ #ifdef _XOPEN_SOURCE
++ # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */
++ #endif
+
+ #define PY_SSIZE_T_CLEAN
+
+*** ../vim-7.2.287/src/version.c 2009-11-11 14:45:36.000000000 +0100
+--- src/version.c 2009-11-11 15:05:51.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 288,
+ /**/
+
+--
+I am always surprised in the Linux world how quickly solutions can be
+obtained. (Imagine sending an email to Bill Gates, asking why Windows
+crashed, and how to fix it... and then getting an answer that fixed the
+problem... <0>_<0> !) -- Mark Langdon
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.289
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.289
+Problem: Checking wrong struct member.
+Solution: Change tb_buf to tb_noremap. (Dominique Pelle)
+Files: src/getchar.c
+
+
+*** ../vim-7.2.288/src/getchar.c 2009-09-30 15:15:33.000000000 +0200
+--- src/getchar.c 2009-11-11 12:50:58.000000000 +0100
+***************
+*** 22,28 ****
+ * These buffers are used for storing:
+ * - stuffed characters: A command that is translated into another command.
+ * - redo characters: will redo the last change.
+! * - recorded chracters: for the "q" command.
+ *
+ * The bytes are stored like in the typeahead buffer:
+ * - K_SPECIAL introduces a special key (two more bytes follow). A literal
+--- 22,28 ----
+ * These buffers are used for storing:
+ * - stuffed characters: A command that is translated into another command.
+ * - redo characters: will redo the last change.
+! * - recorded characters: for the "q" command.
+ *
+ * The bytes are stored like in the typeahead buffer:
+ * - K_SPECIAL introduces a special key (two more bytes follow). A literal
+***************
+*** 1283,1289 ****
+ EMSG2(_(e_intern2), "Free typebuf 1");
+ else
+ vim_free(typebuf.tb_buf);
+! if (typebuf.tb_buf == noremapbuf_init)
+ EMSG2(_(e_intern2), "Free typebuf 2");
+ else
+ vim_free(typebuf.tb_noremap);
+--- 1283,1289 ----
+ EMSG2(_(e_intern2), "Free typebuf 1");
+ else
+ vim_free(typebuf.tb_buf);
+! if (typebuf.tb_noremap == noremapbuf_init)
+ EMSG2(_(e_intern2), "Free typebuf 2");
+ else
+ vim_free(typebuf.tb_noremap);
+***************
+*** 1516,1522 ****
+ * wanted.
+ * This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte.
+ * Collects the bytes of a multibyte character into the whole character.
+! * Returns the modifers in the global "mod_mask".
+ */
+ int
+ vgetc()
+--- 1516,1522 ----
+ * wanted.
+ * This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte.
+ * Collects the bytes of a multibyte character into the whole character.
+! * Returns the modifiers in the global "mod_mask".
+ */
+ int
+ vgetc()
+***************
+*** 3320,3326 ****
+ retval = 1;
+ goto theend;
+ }
+! /* An abbrevation cannot contain white space. */
+ for (n = 0; n < len; ++n)
+ if (vim_iswhite(keys[n]))
+ {
+--- 3320,3326 ----
+ retval = 1;
+ goto theend;
+ }
+! /* An abbreviation cannot contain white space. */
+ for (n = 0; n < len; ++n)
+ if (vim_iswhite(keys[n]))
+ {
+***************
+*** 4272,4278 ****
+
+ /*
+ * Check for word before the cursor: If it ends in a keyword char all
+! * chars before it must be al keyword chars or non-keyword chars, but not
+ * white space. If it ends in a non-keyword char we accept any characters
+ * before it except white space.
+ */
+--- 4272,4278 ----
+
+ /*
+ * Check for word before the cursor: If it ends in a keyword char all
+! * chars before it must be keyword chars or non-keyword chars, but not
+ * white space. If it ends in a non-keyword char we accept any characters
+ * before it except white space.
+ */
+*** ../vim-7.2.288/src/version.c 2009-11-11 15:06:59.000000000 +0100
+--- src/version.c 2009-11-11 16:19:12.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 289,
+ /**/
+
+--
+A M00se once bit my sister ...
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.290
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.290
+Problem: Not freeing memory from ":lmap", ":xmap" and ":menutranslate".
+Solution: Free the memory when exiting. (Dominique Pelle)
+Files: src/misc2.c
+
+
+*** ../vim-7.2.289/src/misc2.c 2009-11-03 16:44:04.000000000 +0100
+--- src/misc2.c 2009-11-11 16:49:13.000000000 +0100
+***************
+*** 1005,1013 ****
+--- 1005,1018 ----
+ # ifdef FEAT_MENU
+ /* Clear menus. */
+ do_cmdline_cmd((char_u *)"aunmenu *");
++ # ifdef FEAT_MULTI_LANG
++ do_cmdline_cmd((char_u *)"menutranslate clear");
++ # endif
+ # endif
+
+ /* Clear mappings, abbreviations, breakpoints. */
++ do_cmdline_cmd((char_u *)"lmapclear");
++ do_cmdline_cmd((char_u *)"xmapclear");
+ do_cmdline_cmd((char_u *)"mapclear");
+ do_cmdline_cmd((char_u *)"mapclear!");
+ do_cmdline_cmd((char_u *)"abclear");
+***************
+*** 1282,1288 ****
+
+ /*
+ * Escape "string" for use as a shell argument with system().
+! * This uses single quotes, except when we know we need to use double qoutes
+ * (MS-DOS and MS-Windows without 'shellslash' set).
+ * Escape a newline, depending on the 'shell' option.
+ * When "do_special" is TRUE also replace "!", "%", "#" and things starting
+--- 1287,1293 ----
+
+ /*
+ * Escape "string" for use as a shell argument with system().
+! * This uses single quotes, except when we know we need to use double quotes
+ * (MS-DOS and MS-Windows without 'shellslash' set).
+ * Escape a newline, depending on the 'shell' option.
+ * When "do_special" is TRUE also replace "!", "%", "#" and things starting
+***************
+*** 1537,1543 ****
+ #if defined(FEAT_VISUALEXTRA) || defined(PROTO)
+ /*
+ * Copy a character a number of times.
+! * Does not work for multi-byte charactes!
+ */
+ void
+ copy_chars(ptr, count, c)
+--- 1542,1548 ----
+ #if defined(FEAT_VISUALEXTRA) || defined(PROTO)
+ /*
+ * Copy a character a number of times.
+! * Does not work for multi-byte characters!
+ */
+ void
+ copy_chars(ptr, count, c)
+***************
+*** 4260,4266 ****
+ * or '**76' is transposed to '**N'( 'N' is ASCII value 76).
+ * For EBCDIC you get different character values.
+ * If no restrict is given after '**' the default is used.
+! * Due to this technic the path looks awful if you print it as a
+ * string.
+ */
+ len = 0;
+--- 4265,4271 ----
+ * or '**76' is transposed to '**N'( 'N' is ASCII value 76).
+ * For EBCDIC you get different character values.
+ * If no restrict is given after '**' the default is used.
+! * Due to this technique the path looks awful if you print it as a
+ * string.
+ */
+ len = 0;
+***************
+*** 4649,4655 ****
+ && !mch_isdir(stackp->ffs_filearray[i]))
+ continue; /* not a directory */
+
+! /* prepare the filename to be checked for existance
+ * below */
+ STRCPY(file_path, stackp->ffs_filearray[i]);
+ add_pathsep(file_path);
+--- 4654,4660 ----
+ && !mch_isdir(stackp->ffs_filearray[i]))
+ continue; /* not a directory */
+
+! /* prepare the filename to be checked for existence
+ * below */
+ STRCPY(file_path, stackp->ffs_filearray[i]);
+ add_pathsep(file_path);
+***************
+*** 5438,5444 ****
+ #if defined(MSWIN) || defined(MSDOS) || defined(OS2)
+ /* handle "\tmp" as absolute path */
+ || vim_ispathsep(ff_file_to_find[0])
+! /* handle "c:name" as absulute path */
+ || (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':')
+ #endif
+ #ifdef AMIGA
+--- 5443,5449 ----
+ #if defined(MSWIN) || defined(MSDOS) || defined(OS2)
+ /* handle "\tmp" as absolute path */
+ || vim_ispathsep(ff_file_to_find[0])
+! /* handle "c:name" as absolute path */
+ || (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':')
+ #endif
+ #ifdef AMIGA
+***************
+*** 5681,5687 ****
+ p2 = (char_u *)base + (j + gap) * elm_size;
+ if ((*cmp)((void *)p1, (void *)p2) <= 0)
+ break;
+! /* Exchange the elemets. */
+ mch_memmove(buf, p1, elm_size);
+ mch_memmove(p1, p2, elm_size);
+ mch_memmove(p2, buf, elm_size);
+--- 5686,5692 ----
+ p2 = (char_u *)base + (j + gap) * elm_size;
+ if ((*cmp)((void *)p1, (void *)p2) <= 0)
+ break;
+! /* Exchange the elements. */
+ mch_memmove(buf, p1, elm_size);
+ mch_memmove(p1, p2, elm_size);
+ mch_memmove(p2, buf, elm_size);
+*** ../vim-7.2.289/src/version.c 2009-11-11 16:23:37.000000000 +0100
+--- src/version.c 2009-11-11 16:54:53.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 290,
+ /**/
+
+--
+ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot.
+ King of all Britons, defeator of the Saxons, sovereign of all England!
+ [Pause]
+SOLDIER: Get away!
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.291
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.291
+Problem: Reading uninitialised memory in arabic mode.
+Solution: Use utfc_ptr2char_len() rather than utfc_ptr2char(). (Dominique
+ Pelle)
+Files: src/screen.c
+
+
+*** ../vim-7.2.290/src/screen.c 2009-11-03 17:36:09.000000000 +0100
+--- src/screen.c 2009-11-11 17:04:53.000000000 +0100
+***************
+*** 6413,6419 ****
+ }
+ else
+ {
+! nc = utfc_ptr2char(ptr + mbyte_blen, pcc);
+ nc1 = pcc[0];
+ }
+ pc = prev_c;
+--- 6413,6420 ----
+ }
+ else
+ {
+! nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc,
+! (int)((text + len) - ptr - mbyte_blen));
+ nc1 = pcc[0];
+ }
+ pc = prev_c;
+*** ../vim-7.2.290/src/version.c 2009-11-11 16:56:13.000000000 +0100
+--- src/version.c 2009-11-11 17:06:48.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 291,
+ /**/
+
+--
+The problem with political jokes is that they get elected.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.292
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.292
+Problem: Block right-shift doesn't work properly with multi-byte encoding
+ and 'list' set.
+Solution: Add the missing "else". (Lech Lorens)
+Files: src/ops.c
+
+
+*** ../vim-7.2.291/src/ops.c 2009-11-03 16:44:04.000000000 +0100
+--- src/ops.c 2009-11-11 17:15:04.000000000 +0100
+***************
+*** 422,429 ****
+ #ifdef FEAT_MBYTE
+ if (has_mbyte)
+ bd.textstart += (*mb_ptr2len)(bd.textstart);
+ #endif
+! ++bd.textstart;
+ }
+ for ( ; vim_iswhite(*bd.textstart); )
+ {
+--- 422,430 ----
+ #ifdef FEAT_MBYTE
+ if (has_mbyte)
+ bd.textstart += (*mb_ptr2len)(bd.textstart);
++ else
+ #endif
+! ++bd.textstart;
+ }
+ for ( ; vim_iswhite(*bd.textstart); )
+ {
+*** ../vim-7.2.291/src/version.c 2009-11-11 17:07:25.000000000 +0100
+--- src/version.c 2009-11-11 17:21:31.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 292,
+ /**/
+
+--
+Computers make very fast, very accurate, mistakes.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.293
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.293
+Problem: When setting 'comments' option it may be used in a wrong way.
+Solution: Don't increment after skipping over digets. (Yukihiro Nakadaira)
+Files: src/misc1.c
+
+
+*** ../vim-7.2.292/src/misc1.c 2009-11-03 18:46:53.000000000 +0100
+--- src/misc1.c 2009-11-11 17:27:38.000000000 +0100
+***************
+*** 1026,1037 ****
+ int c = 0;
+ int off = 0;
+
+! for (p = lead_flags; *p && *p != ':'; ++p)
+ {
+ if (*p == COM_RIGHT || *p == COM_LEFT)
+! c = *p;
+ else if (VIM_ISDIGIT(*p) || *p == '-')
+ off = getdigits(&p);
+ }
+ if (c == COM_RIGHT) /* right adjusted leader */
+ {
+--- 1026,1039 ----
+ int c = 0;
+ int off = 0;
+
+! for (p = lead_flags; *p != NUL && *p != ':'; )
+ {
+ if (*p == COM_RIGHT || *p == COM_LEFT)
+! c = *p++;
+ else if (VIM_ISDIGIT(*p) || *p == '-')
+ off = getdigits(&p);
++ else
++ ++p;
+ }
+ if (c == COM_RIGHT) /* right adjusted leader */
+ {
+*** ../vim-7.2.292/src/version.c 2009-11-11 17:22:30.000000000 +0100
+--- src/version.c 2009-11-11 17:29:24.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 293,
+ /**/
+
+--
+SOLDIER: What? Ridden on a horse?
+ARTHUR: Yes!
+SOLDIER: You're using coconuts!
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.294
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.294
+Problem: When using TEMPDIRS dir name could get too long.
+Solution: Overwrite tail instead of appending each time. Use mkdtemp() when
+ available. (James Vega)
+Files: src/auto/configure, src/config.h.in, src/configure.in, src/fileio.c
+
+
+*** ../vim-7.2.293/src/auto/configure 2009-09-11 13:44:33.000000000 +0200
+--- src/auto/configure 2009-11-17 12:03:15.000000000 +0100
+***************
+*** 14019,14027 ****
+
+
+
+ for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
+ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
+! memset nanosleep opendir putenv qsort readlink select setenv \
+ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
+ sigvec strcasecmp strerror strftime stricmp strncasecmp \
+ strnicmp strpbrk strtol tgetent towlower towupper iswupper \
+--- 14019,14028 ----
+
+
+
++
+ for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
+ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
+! memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
+ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
+ sigvec strcasecmp strerror strftime stricmp strncasecmp \
+ strnicmp strpbrk strtol tgetent towlower towupper iswupper \
+*** ../vim-7.2.293/src/config.h.in 2009-05-21 23:25:38.000000000 +0200
+--- src/config.h.in 2009-11-11 17:40:21.000000000 +0100
+***************
+*** 157,162 ****
+--- 157,163 ----
+ #undef HAVE_LSTAT
+ #undef HAVE_MEMCMP
+ #undef HAVE_MEMSET
++ #undef HAVE_MKDTEMP
+ #undef HAVE_NANOSLEEP
+ #undef HAVE_OPENDIR
+ #undef HAVE_FLOAT_FUNCS
+*** ../vim-7.2.293/src/configure.in 2009-09-11 13:44:33.000000000 +0200
+--- src/configure.in 2009-11-11 17:40:21.000000000 +0100
+***************
+*** 2635,2641 ****
+ dnl Check for functions in one big call, to reduce the size of configure
+ AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
+ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
+! memset nanosleep opendir putenv qsort readlink select setenv \
+ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
+ sigvec strcasecmp strerror strftime stricmp strncasecmp \
+ strnicmp strpbrk strtol tgetent towlower towupper iswupper \
+--- 2635,2641 ----
+ dnl Check for functions in one big call, to reduce the size of configure
+ AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
+ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
+! memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
+ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
+ sigvec strcasecmp strerror strftime stricmp strncasecmp \
+ strnicmp strpbrk strtol tgetent towlower towupper iswupper \
+*** ../vim-7.2.293/src/fileio.c 2009-09-11 17:24:01.000000000 +0200
+--- src/fileio.c 2009-11-11 18:01:22.000000000 +0100
+***************
+*** 146,151 ****
+--- 146,152 ----
+ # endif
+ #endif
+ static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
++ static void vim_settempdir __ARGS((char_u *tempdir));
+ #ifdef FEAT_AUTOCMD
+ static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
+ #endif
+***************
+*** 6987,6992 ****
+--- 6988,7020 ----
+ #endif
+
+ /*
++ * Directory "tempdir" was created. Expand this name to a full path and put
++ * it in "vim_tempdir". This avoids that using ":cd" would confuse us.
++ * "tempdir" must be no longer than MAXPATHL.
++ */
++ static void
++ vim_settempdir(tempdir)
++ char_u *tempdir;
++ {
++ char_u *buf;
++
++ buf = alloc((unsigned)MAXPATHL + 2);
++ if (buf != NULL)
++ {
++ if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL)
++ STRCPY(buf, tempdir);
++ # ifdef __EMX__
++ if (vim_strchr(buf, '/') != NULL)
++ STRCAT(buf, "/");
++ else
++ # endif
++ add_pathsep(buf);
++ vim_tempdir = vim_strsave(buf);
++ vim_free(buf);
++ }
++ }
++
++ /*
+ * vim_tempname(): Return a unique name that can be used for a temp file.
+ *
+ * The temp file is NOT created.
+***************
+*** 7007,7014 ****
+ #ifdef TEMPDIRNAMES
+ static char *(tempdirs[]) = {TEMPDIRNAMES};
+ int i;
+- long nr;
+- long off;
+ # ifndef EEXIST
+ struct stat st;
+ # endif
+--- 7035,7040 ----
+***************
+*** 7027,7032 ****
+--- 7053,7064 ----
+ */
+ for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
+ {
++ size_t itmplen;
++ # ifndef HAVE_MKDTEMP
++ long nr;
++ long off;
++ # endif
++
+ /* expand $TMP, leave room for "/v1100000/999999999" */
+ expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
+ if (mch_isdir(itmp)) /* directory exists */
+***************
+*** 7040,7046 ****
+--- 7072,7085 ----
+ else
+ # endif
+ add_pathsep(itmp);
++ itmplen = STRLEN(itmp);
+
++ # ifdef HAVE_MKDTEMP
++ /* Leave room for filename */
++ STRCAT(itmp, "vXXXXXX");
++ if (mkdtemp((char *)itmp) != NULL)
++ vim_settempdir(itmp);
++ # else
+ /* Get an arbitrary number of up to 6 digits. When it's
+ * unlikely that it already exists it will be faster,
+ * otherwise it doesn't matter. The use of mkdir() avoids any
+***************
+*** 7052,7110 ****
+ for (off = 0; off < 10000L; ++off)
+ {
+ int r;
+! #if defined(UNIX) || defined(VMS)
+ mode_t umask_save;
+! #endif
+
+! sprintf((char *)itmp + STRLEN(itmp), "v%ld", nr + off);
+! # ifndef EEXIST
+ /* If mkdir() does not set errno to EEXIST, check for
+ * existing file here. There is a race condition then,
+ * although it's fail-safe. */
+ if (mch_stat((char *)itmp, &st) >= 0)
+ continue;
+! # endif
+! #if defined(UNIX) || defined(VMS)
+ /* Make sure the umask doesn't remove the executable bit.
+ * "repl" has been reported to use "177". */
+ umask_save = umask(077);
+! #endif
+ r = vim_mkdir(itmp, 0700);
+! #if defined(UNIX) || defined(VMS)
+ (void)umask(umask_save);
+! #endif
+ if (r == 0)
+ {
+! char_u *buf;
+!
+! /* Directory was created, use this name.
+! * Expand to full path; When using the current
+! * directory a ":cd" would confuse us. */
+! buf = alloc((unsigned)MAXPATHL + 1);
+! if (buf != NULL)
+! {
+! if (vim_FullName(itmp, buf, MAXPATHL, FALSE)
+! == FAIL)
+! STRCPY(buf, itmp);
+! # ifdef __EMX__
+! if (vim_strchr(buf, '/') != NULL)
+! STRCAT(buf, "/");
+! else
+! # endif
+! add_pathsep(buf);
+! vim_tempdir = vim_strsave(buf);
+! vim_free(buf);
+! }
+ break;
+ }
+! # ifdef EEXIST
+ /* If the mkdir() didn't fail because the file/dir exists,
+ * we probably can't create any dir here, try another
+ * place. */
+ if (errno != EEXIST)
+! # endif
+ break;
+ }
+ if (vim_tempdir != NULL)
+ break;
+ }
+--- 7091,7131 ----
+ for (off = 0; off < 10000L; ++off)
+ {
+ int r;
+! # if defined(UNIX) || defined(VMS)
+ mode_t umask_save;
+! # endif
+
+! sprintf((char *)itmp + itmplen, "v%ld", nr + off);
+! # ifndef EEXIST
+ /* If mkdir() does not set errno to EEXIST, check for
+ * existing file here. There is a race condition then,
+ * although it's fail-safe. */
+ if (mch_stat((char *)itmp, &st) >= 0)
+ continue;
+! # endif
+! # if defined(UNIX) || defined(VMS)
+ /* Make sure the umask doesn't remove the executable bit.
+ * "repl" has been reported to use "177". */
+ umask_save = umask(077);
+! # endif
+ r = vim_mkdir(itmp, 0700);
+! # if defined(UNIX) || defined(VMS)
+ (void)umask(umask_save);
+! # endif
+ if (r == 0)
+ {
+! vim_settempdir(itmp);
+ break;
+ }
+! # ifdef EEXIST
+ /* If the mkdir() didn't fail because the file/dir exists,
+ * we probably can't create any dir here, try another
+ * place. */
+ if (errno != EEXIST)
+! # endif
+ break;
+ }
++ # endif /* HAVE_MKDTEMP */
+ if (vim_tempdir != NULL)
+ break;
+ }
+*** ../vim-7.2.293/src/version.c 2009-11-11 17:30:05.000000000 +0100
+--- src/version.c 2009-11-17 11:54:49.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 294,
+ /**/
+
+--
+ARTHUR: Now stand aside worthy adversary.
+BLACK KNIGHT: (Glancing at his shoulder) 'Tis but a scratch.
+ARTHUR: A scratch? Your arm's off.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.295
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.295
+Problem: When using map() on a List the index is not known.
+Solution: Set v:key to the index. (Hari Krishna Dara)
+Files: runtime/doc/eval.txt, src/eval.c
+
+
+*** ../vim-7.2.294/runtime/doc/eval.txt 2009-11-11 14:21:48.000000000 +0100
+--- runtime/doc/eval.txt 2009-11-11 18:22:54.000000000 +0100
+***************
+*** 3802,3808 ****
+ Replace each item in {expr} with the result of evaluating
+ {string}.
+ Inside {string} |v:val| has the value of the current item.
+! For a |Dictionary| |v:key| has the key of the current item.
+ Example: >
+ :call map(mylist, '"> " . v:val . " <"')
+ < This puts "> " before and " <" after each item in "mylist".
+--- 3812,3819 ----
+ Replace each item in {expr} with the result of evaluating
+ {string}.
+ Inside {string} |v:val| has the value of the current item.
+! For a |Dictionary| |v:key| has the key of the current item
+! and for a |List| |v:key| has the index of the current item.
+ Example: >
+ :call map(mylist, '"> " . v:val . " <"')
+ < This puts "> " before and " <" after each item in "mylist".
+*** ../vim-7.2.294/src/eval.c 2009-11-11 14:21:48.000000000 +0100
+--- src/eval.c 2009-11-11 18:22:49.000000000 +0100
+***************
+*** 9928,9933 ****
+--- 9928,9934 ----
+ int todo;
+ char_u *ermsg = map ? (char_u *)"map()" : (char_u *)"filter()";
+ int save_did_emsg;
++ int index = 0;
+
+ if (argvars[0].v_type == VAR_LIST)
+ {
+***************
+*** 9961,9969 ****
+ save_did_emsg = did_emsg;
+ did_emsg = FALSE;
+
+ if (argvars[0].v_type == VAR_DICT)
+ {
+- prepare_vimvar(VV_KEY, &save_key);
+ vimvars[VV_KEY].vv_type = VAR_STRING;
+
+ ht = &d->dv_hashtab;
+--- 9962,9970 ----
+ save_did_emsg = did_emsg;
+ did_emsg = FALSE;
+
++ prepare_vimvar(VV_KEY, &save_key);
+ if (argvars[0].v_type == VAR_DICT)
+ {
+ vimvars[VV_KEY].vv_type = VAR_STRING;
+
+ ht = &d->dv_hashtab;
+***************
+*** 9987,10010 ****
+ }
+ }
+ hash_unlock(ht);
+-
+- restore_vimvar(VV_KEY, &save_key);
+ }
+ else
+ {
+ for (li = l->lv_first; li != NULL; li = nli)
+ {
+ if (tv_check_lock(li->li_tv.v_lock, ermsg))
+ break;
+ nli = li->li_next;
+ if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
+ || did_emsg)
+ break;
+ if (!map && rem)
+ listitem_remove(l, li);
+ }
+ }
+
+ restore_vimvar(VV_VAL, &save_val);
+
+ did_emsg |= save_did_emsg;
+--- 9988,10014 ----
+ }
+ }
+ hash_unlock(ht);
+ }
+ else
+ {
++ vimvars[VV_KEY].vv_type = VAR_NUMBER;
++
+ for (li = l->lv_first; li != NULL; li = nli)
+ {
+ if (tv_check_lock(li->li_tv.v_lock, ermsg))
+ break;
+ nli = li->li_next;
++ vimvars[VV_KEY].vv_nr = index;
+ if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL
+ || did_emsg)
+ break;
+ if (!map && rem)
+ listitem_remove(l, li);
++ ++index;
+ }
+ }
+
++ restore_vimvar(VV_KEY, &save_key);
+ restore_vimvar(VV_VAL, &save_val);
+
+ did_emsg |= save_did_emsg;
+*** ../vim-7.2.294/src/version.c 2009-11-17 12:08:48.000000000 +0100
+--- src/version.c 2009-11-17 12:18:08.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 295,
+ /**/
+
+--
+ARTHUR: You are indeed brave Sir knight, but the fight is mine.
+BLACK KNIGHT: Had enough?
+ARTHUR: You stupid bastard. You havn't got any arms left.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.296
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.296
+Problem: Help message about startuptime is wrong. (Dominique Pelle)
+Solution: Remove the equal sign.
+Files: src/main.c
+
+
+*** ../vim-7.2.295/src/main.c 2009-11-11 14:21:48.000000000 +0100
+--- src/main.c 2009-11-11 22:51:04.000000000 +0100
+***************
+*** 3151,3157 ****
+ main_msg(_("--servername <name>\tSend to/become the Vim server <name>"));
+ #endif
+ #ifdef STARTUPTIME
+! main_msg(_("--startuptime=<file>\tWrite startup timing messages to <file>"));
+ #endif
+ #ifdef FEAT_VIMINFO
+ main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
+--- 3151,3157 ----
+ main_msg(_("--servername <name>\tSend to/become the Vim server <name>"));
+ #endif
+ #ifdef STARTUPTIME
+! main_msg(_("--startuptime <file>\tWrite startup timing messages to <file>"));
+ #endif
+ #ifdef FEAT_VIMINFO
+ main_msg(_("-i <viminfo>\t\tUse <viminfo> instead of .viminfo"));
+*** ../vim-7.2.295/src/version.c 2009-11-17 12:20:30.000000000 +0100
+--- src/version.c 2009-11-17 12:30:29.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 296,
+ /**/
+
+--
+BLACK KNIGHT: I'm invincible!
+ARTHUR: You're a looney.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.297
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.297
+Problem: Reading freed memory when writing ":reg" output to a register.
+ (Dominique Pelle)
+Solution: Skip the register being written to.
+Files: src/ops.c
+
+
+*** ../vim-7.2.296/src/ops.c 2009-11-11 17:22:30.000000000 +0100
+--- src/ops.c 2009-11-11 19:30:47.000000000 +0100
+***************
+*** 3991,3996 ****
+--- 3991,4004 ----
+ }
+ else
+ yb = &(y_regs[i]);
++
++ #ifdef FEAT_EVAL
++ if (name == MB_TOLOWER(redir_reg)
++ || (redir_reg == '"' && yb == y_previous))
++ continue; /* do not list register being written to, the
++ * pointer can be freed */
++ #endif
++
+ if (yb->y_array != NULL)
+ {
+ msg_putchar('\n');
+***************
+*** 6090,6096 ****
+ long maxlen;
+ #endif
+
+! if (y_ptr->y_array == NULL) /* NULL means emtpy register */
+ y_ptr->y_size = 0;
+
+ /*
+--- 6098,6104 ----
+ long maxlen;
+ #endif
+
+! if (y_ptr->y_array == NULL) /* NULL means empty register */
+ y_ptr->y_size = 0;
+
+ /*
+*** ../vim-7.2.296/src/version.c 2009-11-17 12:31:30.000000000 +0100
+--- src/version.c 2009-11-17 12:42:28.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 297,
+ /**/
+
+--
+"Beware of bugs in the above code; I have only proved
+it correct, not tried it." -- Donald Knuth
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.298
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.298
+Problem: ":vimgrep" crashes when there is an autocommand that sets a
+ window-local variable.
+Solution: Initialize the w: hashtab for re-use. (Yukihiro Nakadaira)
+Files: src/fileio.c
+
+
+*** ../vim-7.2.297/src/fileio.c 2009-11-17 12:08:48.000000000 +0100
+--- src/fileio.c 2009-11-17 13:22:06.000000000 +0100
+***************
+*** 8597,8602 ****
+--- 8605,8611 ----
+ curwin = firstwin;
+ # ifdef FEAT_EVAL
+ vars_clear(&aucmd_win->w_vars.dv_hashtab); /* free all w: variables */
++ hash_init(&aucmd_win->w_vars.dv_hashtab); /* re-use the hashtab */
+ # endif
+ #else
+ curwin = aco->save_curwin;
+*** ../vim-7.2.297/src/version.c 2009-11-17 12:43:19.000000000 +0100
+--- src/version.c 2009-11-17 14:56:19.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 298,
+ /**/
+
+--
+Eye have a spelling checker, it came with my PC;
+It plainly marks four my revue mistakes I cannot sea.
+I've run this poem threw it, I'm sure your please to no,
+It's letter perfect in it's weigh, my checker tolled me sew!
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.299
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.299
+Problem: Crash when comment middle is longer than start.
+Solution: Fix size computation. (Lech Lorens)
+Files: src/misc1.c
+
+
+*** ../vim-7.2.298/src/misc1.c 2009-11-11 17:30:05.000000000 +0100
+--- src/misc1.c 2009-11-17 15:59:28.000000000 +0100
+***************
+*** 1121,1127 ****
+ if (i != lead_repl_len)
+ {
+ mch_memmove(p + lead_repl_len, p + i,
+! (size_t)(lead_len - i - (leader - p)));
+ lead_len += lead_repl_len - i;
+ }
+ }
+--- 1121,1127 ----
+ if (i != lead_repl_len)
+ {
+ mch_memmove(p + lead_repl_len, p + i,
+! (size_t)(lead_len - i - (p - leader)));
+ lead_len += lead_repl_len - i;
+ }
+ }
+*** ../vim-7.2.298/src/version.c 2009-11-17 14:57:19.000000000 +0100
+--- src/version.c 2009-11-17 16:01:07.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 299,
+ /**/
+
+--
+BLACK KNIGHT: The Black Knight always triumphs. Have at you!
+ ARTHUR takes his last leg off. The BLACK KNIGHT's body lands upright.
+BLACK KNIGHT: All right, we'll call it a draw.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.300
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.300
+Problem: Vim doesn't close file descriptors when forking and executing
+ another command, e.g., ":shell".
+Solution: Use FD_CLOEXEC when available. (James Vega)
+Files: src/auto/configure, src/config.h.in, src/configure.in,
+ src/ex_cmdds2.c, src/fileio.c, src/memfile.c, src/memline.c
+
+
+*** ../vim-7.2.299/src/auto/configure 2009-11-17 12:08:48.000000000 +0100
+--- src/auto/configure 2009-11-17 13:09:03.000000000 +0100
+***************
+*** 15174,15179 ****
+--- 15174,15231 ----
+ $as_echo "yes" >&6; }
+ fi
+
++ { $as_echo "$as_me:$LINENO: checking for FD_CLOEXEC" >&5
++ $as_echo_n "checking for FD_CLOEXEC... " >&6; }
++ cat >conftest.$ac_ext <<_ACEOF
++ /* confdefs.h. */
++ _ACEOF
++ cat confdefs.h >>conftest.$ac_ext
++ cat >>conftest.$ac_ext <<_ACEOF
++ /* end confdefs.h. */
++ #if HAVE_FCNTL_H
++ # include <fcntl.h>
++ #endif
++ int
++ main ()
++ {
++ int flag = FD_CLOEXEC;
++ ;
++ return 0;
++ }
++ _ACEOF
++ rm -f conftest.$ac_objext
++ if { (ac_try="$ac_compile"
++ case "(($ac_try" in
++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
++ *) ac_try_echo=$ac_try;;
++ esac
++ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
++ $as_echo "$ac_try_echo") >&5
++ (eval "$ac_compile") 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } && {
++ test -z "$ac_c_werror_flag" ||
++ test ! -s conftest.err
++ } && test -s conftest.$ac_objext; then
++ { $as_echo "$as_me:$LINENO: result: yes" >&5
++ $as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF
++ #define HAVE_FD_CLOEXEC 1
++ _ACEOF
++
++ else
++ $as_echo "$as_me: failed program was:" >&5
++ sed 's/^/| /' conftest.$ac_ext >&5
++
++ { $as_echo "$as_me:$LINENO: result: not usable" >&5
++ $as_echo "not usable" >&6; }
++ fi
++
++ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
+ { $as_echo "$as_me:$LINENO: checking for rename" >&5
+ $as_echo_n "checking for rename... " >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+*** ../vim-7.2.299/src/config.h.in 2009-11-17 12:08:48.000000000 +0100
+--- src/config.h.in 2009-11-17 13:01:36.000000000 +0100
+***************
+*** 388,390 ****
+--- 388,393 ----
+
+ /* Define if you want XSMP interaction as well as vanilla swapfile safety */
+ #undef USE_XSMP_INTERACT
++
++ /* Define if fcntl()'s F_SETFD command knows about FD_CLOEXEC */
++ #undef HAVE_FD_CLOEXEC
+*** ../vim-7.2.299/src/configure.in 2009-11-17 12:08:48.000000000 +0100
+--- src/configure.in 2009-11-17 13:01:36.000000000 +0100
+***************
+*** 2855,2860 ****
+--- 2855,2870 ----
+ AC_MSG_RESULT(yes)
+ fi
+
++ dnl make sure the FD_CLOEXEC flag for fcntl()'s F_SETFD command is known
++ AC_MSG_CHECKING(for FD_CLOEXEC)
++ AC_TRY_COMPILE(
++ [#if HAVE_FCNTL_H
++ # include <fcntl.h>
++ #endif],
++ [ int flag = FD_CLOEXEC;],
++ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FD_CLOEXEC),
++ AC_MSG_RESULT(not usable))
++
+ dnl rename needs to be checked separately to work on Nextstep with cc
+ AC_MSG_CHECKING(for rename)
+ AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
+*** ../vim-7.2.299/src/fileio.c 2009-11-17 14:57:19.000000000 +0100
+--- src/fileio.c 2009-11-17 13:22:06.000000000 +0100
+***************
+*** 2254,2259 ****
+--- 2254,2267 ----
+
+ if (!read_buffer && !read_stdin)
+ close(fd); /* errors are ignored */
++ #ifdef HAVE_FD_CLOEXEC
++ else
++ {
++ int fdflags = fcntl(fd, F_GETFD);
++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
++ fcntl(fd, F_SETFD, fdflags | FD_CLOEXEC);
++ }
++ #endif
+ vim_free(buffer);
+
+ #ifdef HAVE_DUP
+*** ../vim-7.2.299/src/memfile.c 2008-07-13 19:39:39.000000000 +0200
+--- src/memfile.c 2009-11-17 13:22:15.000000000 +0100
+***************
+*** 1343,1348 ****
+--- 1343,1353 ----
+ }
+ else
+ {
++ #ifdef HAVE_FD_CLOEXEC
++ int fdflags = fcntl(mfp->mf_fd, F_GETFD);
++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
++ fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
++ #endif
+ #ifdef HAVE_SELINUX
+ mch_copy_sec(fname, mfp->mf_fname);
+ #endif
+*** ../vim-7.2.299/src/memline.c 2009-11-03 15:32:58.000000000 +0100
+--- src/memline.c 2009-11-17 13:21:40.000000000 +0100
+***************
+*** 382,388 ****
+ dp->db_index[0] = --dp->db_txt_start; /* at end of block */
+ dp->db_free -= 1 + INDEX_SIZE;
+ dp->db_line_count = 1;
+! *((char_u *)dp + dp->db_txt_start) = NUL; /* emtpy line */
+
+ return OK;
+
+--- 382,388 ----
+ dp->db_index[0] = --dp->db_txt_start; /* at end of block */
+ dp->db_free -= 1 + INDEX_SIZE;
+ dp->db_line_count = 1;
+! *((char_u *)dp + dp->db_txt_start) = NUL; /* empty line */
+
+ return OK;
+
+***************
+*** 490,495 ****
+--- 490,502 ----
+ EMSG(_("E301: Oops, lost the swap file!!!"));
+ return;
+ }
++ #ifdef HAVE_FD_CLOEXEC
++ {
++ int fdflags = fcntl(mfp->mf_fd, F_GETFD);
++ if (fdflags >= 0 && (fdflags & FD_CLOEXEC) == 0)
++ fcntl(mfp->mf_fd, F_SETFD, fdflags | FD_CLOEXEC);
++ }
++ #endif
+ }
+ if (!success)
+ EMSG(_("E302: Could not rename swap file"));
+*** ../vim-7.2.299/src/version.c 2009-11-17 16:08:12.000000000 +0100
+--- src/version.c 2009-11-17 17:09:43.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 300,
+ /**/
+
+--
+ |
+
+Ceci n'est pas une pipe.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.301
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+NOTE: some mail and patch programs may have a problem with the non-ASCII
+characters in this patch. You can fetch the patch from
+ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.301 and/or fetch the updated
+files from CVS. http://www.vim.org/cvs.php
+
+
+Patch 7.2.301
+Problem: Formatting is wrong when 'tw' is set to a small value.
+Solution: Fix it and add tests. Also fix behavior of "1" in 'fo'. (Yukihiro
+ Nakadaira)
+Files: src/edit.c, src/testdir/Makefile, src/testdir/test68.in,
+ src/testdir/test68.ok, src/testdir/test69.in,
+ src/testdir/test69.ok
+
+
+*** ../vim-7.2.300/src/edit.c 2009-11-11 13:22:32.000000000 +0100
+--- src/edit.c 2009-11-17 15:34:47.000000000 +0100
+***************
+*** 181,187 ****
+ static void ins_ctrl_v __ARGS((void));
+ static void undisplay_dollar __ARGS((void));
+ static void insert_special __ARGS((int, int, int));
+! static void internal_format __ARGS((int textwidth, int second_indent, int flags, int format_only));
+ static void check_auto_format __ARGS((int));
+ static void redo_literal __ARGS((int c));
+ static void start_arrow __ARGS((pos_T *end_insert_pos));
+--- 181,187 ----
+ static void ins_ctrl_v __ARGS((void));
+ static void undisplay_dollar __ARGS((void));
+ static void insert_special __ARGS((int, int, int));
+! static void internal_format __ARGS((int textwidth, int second_indent, int flags, int format_only, int c));
+ static void check_auto_format __ARGS((int));
+ static void redo_literal __ARGS((int c));
+ static void start_arrow __ARGS((pos_T *end_insert_pos));
+***************
+*** 2164,2170 ****
+ int i, c;
+ int actual_len; /* Take multi-byte characters */
+ int actual_compl_length; /* into account. */
+! int *wca; /* Wide character array. */
+ int has_lower = FALSE;
+ int was_letter = FALSE;
+
+--- 2164,2170 ----
+ int i, c;
+ int actual_len; /* Take multi-byte characters */
+ int actual_compl_length; /* into account. */
+! int *wca; /* Wide character array. */
+ int has_lower = FALSE;
+ int was_letter = FALSE;
+
+***************
+*** 5558,5564 ****
+ }
+ if (do_internal)
+ #endif
+! internal_format(textwidth, second_indent, flags, c == NUL);
+ }
+
+ if (c == NUL) /* only formatting was wanted */
+--- 5558,5564 ----
+ }
+ if (do_internal)
+ #endif
+! internal_format(textwidth, second_indent, flags, c == NUL, c);
+ }
+
+ if (c == NUL) /* only formatting was wanted */
+***************
+*** 5738,5748 ****
+ * Format text at the current insert position.
+ */
+ static void
+! internal_format(textwidth, second_indent, flags, format_only)
+ int textwidth;
+ int second_indent;
+ int flags;
+ int format_only;
+ {
+ int cc;
+ int save_char = NUL;
+--- 5738,5749 ----
+ * Format text at the current insert position.
+ */
+ static void
+! internal_format(textwidth, second_indent, flags, format_only, c)
+ int textwidth;
+ int second_indent;
+ int flags;
+ int format_only;
++ int c; /* character to be inserted (can be NUL) */
+ {
+ int cc;
+ int save_char = NUL;
+***************
+*** 5763,5769 ****
+ * When 'ai' is off we don't want a space under the cursor to be
+ * deleted. Replace it with an 'x' temporarily.
+ */
+! if (!curbuf->b_p_ai)
+ {
+ cc = gchar_cursor();
+ if (vim_iswhite(cc))
+--- 5764,5774 ----
+ * When 'ai' is off we don't want a space under the cursor to be
+ * deleted. Replace it with an 'x' temporarily.
+ */
+! if (!curbuf->b_p_ai
+! #ifdef FEAT_VREPLACE
+! && !(State & VREPLACE_FLAG)
+! #endif
+! )
+ {
+ cc = gchar_cursor();
+ if (vim_iswhite(cc))
+***************
+*** 5789,5797 ****
+ char_u *saved_text = NULL;
+ #endif
+ colnr_T col;
+
+! virtcol = get_nolist_virtcol();
+! if (virtcol < (colnr_T)textwidth)
+ break;
+
+ #ifdef FEAT_COMMENTS
+--- 5794,5804 ----
+ char_u *saved_text = NULL;
+ #endif
+ colnr_T col;
++ colnr_T end_col;
+
+! virtcol = get_nolist_virtcol()
+! + char2cells(c != NUL ? c : gchar_cursor());
+! if (virtcol <= (colnr_T)textwidth)
+ break;
+
+ #ifdef FEAT_COMMENTS
+***************
+*** 5831,5842 ****
+ coladvance((colnr_T)textwidth);
+ wantcol = curwin->w_cursor.col;
+
+! curwin->w_cursor.col = startcol - 1;
+! #ifdef FEAT_MBYTE
+! /* Correct cursor for multi-byte character. */
+! if (has_mbyte)
+! mb_adjust_cursor();
+! #endif
+ foundcol = 0;
+
+ /*
+--- 5838,5844 ----
+ coladvance((colnr_T)textwidth);
+ wantcol = curwin->w_cursor.col;
+
+! curwin->w_cursor.col = startcol;
+ foundcol = 0;
+
+ /*
+***************
+*** 5847,5857 ****
+ || curwin->w_cursor.lnum != Insstart.lnum
+ || curwin->w_cursor.col >= Insstart.col)
+ {
+! cc = gchar_cursor();
+ if (WHITECHAR(cc))
+ {
+ /* remember position of blank just before text */
+! end_foundcol = curwin->w_cursor.col;
+
+ /* find start of sequence of blanks */
+ while (curwin->w_cursor.col > 0 && WHITECHAR(cc))
+--- 5849,5862 ----
+ || curwin->w_cursor.lnum != Insstart.lnum
+ || curwin->w_cursor.col >= Insstart.col)
+ {
+! if (curwin->w_cursor.col == startcol && c != NUL)
+! cc = c;
+! else
+! cc = gchar_cursor();
+ if (WHITECHAR(cc))
+ {
+ /* remember position of blank just before text */
+! end_col = curwin->w_cursor.col;
+
+ /* find start of sequence of blanks */
+ while (curwin->w_cursor.col > 0 && WHITECHAR(cc))
+***************
+*** 5871,5877 ****
+ /* do not break after one-letter words */
+ if (curwin->w_cursor.col == 0)
+ break; /* one-letter word at begin */
+!
+ col = curwin->w_cursor.col;
+ dec_cursor();
+ cc = gchar_cursor();
+--- 5876,5886 ----
+ /* do not break after one-letter words */
+ if (curwin->w_cursor.col == 0)
+ break; /* one-letter word at begin */
+! #ifdef FEAT_COMMENTS
+! /* do not break "#a b" when 'tw' is 2 */
+! if (curwin->w_cursor.col <= leader_len)
+! break;
+! #endif
+ col = curwin->w_cursor.col;
+ dec_cursor();
+ cc = gchar_cursor();
+***************
+*** 5880,5905 ****
+ continue; /* one-letter, continue */
+ curwin->w_cursor.col = col;
+ }
+! #ifdef FEAT_MBYTE
+! if (has_mbyte)
+! foundcol = curwin->w_cursor.col
+! + (*mb_ptr2len)(ml_get_cursor());
+! else
+! #endif
+! foundcol = curwin->w_cursor.col + 1;
+! if (curwin->w_cursor.col < (colnr_T)wantcol)
+ break;
+ }
+ #ifdef FEAT_MBYTE
+! else if (cc >= 0x100 && fo_multibyte
+! && curwin->w_cursor.col <= (colnr_T)wantcol)
+ {
+ /* Break after or before a multi-byte character. */
+ foundcol = curwin->w_cursor.col;
+- if (curwin->w_cursor.col < (colnr_T)wantcol)
+- foundcol += (*mb_char2len)(cc);
+ end_foundcol = foundcol;
+! break;
+ }
+ #endif
+ if (curwin->w_cursor.col == 0)
+--- 5889,5948 ----
+ continue; /* one-letter, continue */
+ curwin->w_cursor.col = col;
+ }
+!
+! inc_cursor();
+!
+! end_foundcol = end_col + 1;
+! foundcol = curwin->w_cursor.col;
+! if (curwin->w_cursor.col <= (colnr_T)wantcol)
+ break;
+ }
+ #ifdef FEAT_MBYTE
+! else if (cc >= 0x100 && fo_multibyte)
+ {
+ /* Break after or before a multi-byte character. */
++ if (curwin->w_cursor.col != startcol)
++ {
++ #ifdef FEAT_COMMENTS
++ /* Don't break until after the comment leader */
++ if (curwin->w_cursor.col < leader_len)
++ break;
++ #endif
++ col = curwin->w_cursor.col;
++ inc_cursor();
++ /* Don't change end_foundcol if already set. */
++ if (foundcol != curwin->w_cursor.col)
++ {
++ foundcol = curwin->w_cursor.col;
++ end_foundcol = foundcol;
++ if (curwin->w_cursor.col <= (colnr_T)wantcol)
++ break;
++ }
++ curwin->w_cursor.col = col;
++ }
++
++ if (curwin->w_cursor.col == 0)
++ break;
++
++ col = curwin->w_cursor.col;
++
++ dec_cursor();
++ cc = gchar_cursor();
++
++ if (WHITECHAR(cc))
++ continue; /* break with space */
++ #ifdef FEAT_COMMENTS
++ /* Don't break until after the comment leader */
++ if (curwin->w_cursor.col < leader_len)
++ break;
++ #endif
++
++ curwin->w_cursor.col = col;
++
+ foundcol = curwin->w_cursor.col;
+ end_foundcol = foundcol;
+! if (curwin->w_cursor.col <= (colnr_T)wantcol)
+! break;
+ }
+ #endif
+ if (curwin->w_cursor.col == 0)
+***************
+*** 5926,5939 ****
+ orig_col = startcol; /* Will start backspacing from here */
+ else
+ #endif
+! replace_offset = startcol - end_foundcol - 1;
+
+ /*
+ * adjust startcol for spaces that will be deleted and
+ * characters that will remain on top line
+ */
+ curwin->w_cursor.col = foundcol;
+! while (cc = gchar_cursor(), WHITECHAR(cc))
+ inc_cursor();
+ startcol -= curwin->w_cursor.col;
+ if (startcol < 0)
+--- 5969,5983 ----
+ orig_col = startcol; /* Will start backspacing from here */
+ else
+ #endif
+! replace_offset = startcol - end_foundcol;
+
+ /*
+ * adjust startcol for spaces that will be deleted and
+ * characters that will remain on top line
+ */
+ curwin->w_cursor.col = foundcol;
+! while ((cc = gchar_cursor(), WHITECHAR(cc))
+! && (!fo_white_par || curwin->w_cursor.col < startcol))
+ inc_cursor();
+ startcol -= curwin->w_cursor.col;
+ if (startcol < 0)
+***************
+*** 8509,8515 ****
+ if (mode == BACKSPACE_LINE
+ && (curbuf->b_p_ai
+ #ifdef FEAT_CINDENT
+! || cindent_on()
+ #endif
+ )
+ #ifdef FEAT_RIGHTLEFT
+--- 8553,8559 ----
+ if (mode == BACKSPACE_LINE
+ && (curbuf->b_p_ai
+ #ifdef FEAT_CINDENT
+! || cindent_on()
+ #endif
+ )
+ #ifdef FEAT_RIGHTLEFT
+*** ../vim-7.2.300/src/testdir/Makefile 2009-11-17 17:36:13.000000000 +0100
+--- src/testdir/Makefile 2009-11-17 15:11:26.000000000 +0100
+***************
+*** 22,28 ****
+ test48.out test49.out test51.out test52.out test53.out \
+ test54.out test55.out test56.out test57.out test58.out \
+ test59.out test60.out test61.out test62.out test63.out \
+! test64.out test65.out test66.out test67.out
+
+ SCRIPTS_GUI = test16.out
+
+--- 22,29 ----
+ test48.out test49.out test51.out test52.out test53.out \
+ test54.out test55.out test56.out test57.out test58.out \
+ test59.out test60.out test61.out test62.out test63.out \
+! test64.out test65.out test66.out test67.out test68.out \
+! test69.out
+
+ SCRIPTS_GUI = test16.out
+
+*** ../vim-7.2.300/src/testdir/test68.in 2009-11-17 17:39:36.000000000 +0100
+--- src/testdir/test68.in 2009-11-17 15:39:09.000000000 +0100
+***************
+*** 0 ****
+--- 1,56 ----
++ Test for text formatting.
++
++ Results of test68:
++
++ STARTTEST
++ :so small.vim
++ /^{/+1
++ :set noai tw=2 fo=t
++ gRa b\e
++ ENDTEST
++
++ {
++
++
++ }
++
++ STARTTEST
++ /^{/+1
++ :set ai tw=2 fo=tw
++ gqgqjjllab\e
++ ENDTEST
++
++ {
++ a b
++
++ a
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=3 fo=t
++ gqgqo
++ a \16\ 1\e
++ ENDTEST
++
++ {
++ a \ 1
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=2 fo=tcq1 comments=:#
++ gqgqjgqgqo
++ a b
++ #a b\e
++ ENDTEST
++
++ {
++ a b
++ #a b
++ }
++
++ STARTTEST
++ :g/^STARTTEST/.,/^ENDTEST/d
++ :1;/^Results/,$wq! test.out
++ ENDTEST
+*** ../vim-7.2.300/src/testdir/test68.ok 2009-11-17 17:39:36.000000000 +0100
+--- src/testdir/test68.ok 2009-11-17 15:11:26.000000000 +0100
+***************
+*** 0 ****
+--- 1,35 ----
++ Results of test68:
++
++
++ {
++ a
++ b
++ }
++
++
++ {
++ a
++ b
++
++ a
++ b
++ }
++
++
++ {
++ a
++ \ 1
++
++ a
++ \ 1
++ }
++
++
++ {
++ a b
++ #a b
++
++ a b
++ #a b
++ }
++
+*** ../vim-7.2.300/src/testdir/test69.in 2009-11-17 17:39:36.000000000 +0100
+--- src/testdir/test69.in 2009-11-17 15:11:26.000000000 +0100
+***************
+*** 0 ****
+--- 1,139 ----
++ Test for multi-byte text formatting.
++
++ STARTTEST
++ :so mbyte.vim
++ :set encoding=utf-8
++ ENDTEST
++
++ Results of test69:
++
++ STARTTEST
++ /^{/+1
++ :set tw=2 fo=t
++ gqgqjgqgqo
++ XYZ
++ abc XYZ\e
++ ENDTEST
++
++ {
++ XYZ
++ abc XYZ
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=1 fo=tm
++ gqgqjgqgqjgqgqjgqgqjgqgqo
++ X
++ Xa
++ X a
++ XY
++ X Y\e
++ ENDTEST
++
++ {
++ X
++ Xa
++ X a
++ XY
++ X Y
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=2 fo=tm
++ gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
++ X
++ Xa
++ X a
++ XY
++ X Y
++ aX
++ abX
++ abcX
++ abX c
++ abXY\e
++ ENDTEST
++
++ {
++ X
++ Xa
++ X a
++ XY
++ X Y
++ aX
++ abX
++ abcX
++ abX c
++ abXY
++ }
++
++ STARTTEST
++ /^{/+1
++ :set ai tw=2 fo=tm
++ gqgqjgqgqo
++ X
++ Xa\e
++ ENDTEST
++
++ {
++ X
++ Xa
++ }
++
++ STARTTEST
++ /^{/+1
++ :set noai tw=2 fo=tm
++ gqgqjgqgqo
++ X
++ Xa\e
++ ENDTEST
++
++ {
++ X
++ Xa
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=2 fo=cqm comments=n:X
++ gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
++ X
++ Xa
++ XaY
++ XY
++ XYZ
++ X Y
++ X YZ
++ XX
++ XXa
++ XXY\e
++ ENDTEST
++
++ {
++ X
++ Xa
++ XaY
++ XY
++ XYZ
++ X Y
++ X YZ
++ XX
++ XXa
++ XXY
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=2 fo=tm
++ RXa\e
++ ENDTEST
++
++ {
++
++ }
++
++ STARTTEST
++ :g/^STARTTEST/.,/^ENDTEST/d
++ :1;/^Results/,$wq! test.out
++ ENDTEST
+*** ../vim-7.2.300/src/testdir/test69.ok 2009-11-17 17:39:36.000000000 +0100
+--- src/testdir/test69.ok 2009-11-17 15:11:26.000000000 +0100
+***************
+*** 0 ****
+--- 1,142 ----
++ Results of test69:
++
++
++ {
++ XYZ
++ abc
++ XYZ
++
++ XYZ
++ abc
++ XYZ
++ }
++
++
++ {
++ X
++ X
++ a
++ X
++ a
++ X
++ Y
++ X
++ Y
++
++ X
++ X
++ a
++ X
++ a
++ X
++ Y
++ X
++ Y
++ }
++
++
++ {
++ X
++ X
++ a
++ X
++ a
++ X
++ Y
++ X
++ Y
++ a
++ X
++ ab
++ X
++ abc
++ X
++ ab
++ X
++ c
++ ab
++ X
++ Y
++
++ X
++ X
++ a
++ X
++ a
++ X
++ Y
++ X
++ Y
++ a
++ X
++ ab
++ X
++ abc
++ X
++ ab
++ X
++ c
++ ab
++ X
++ Y
++ }
++
++
++ {
++ X
++ X
++ a
++
++ X
++ X
++ a
++ }
++
++
++ {
++ X
++ X
++ a
++
++ X
++ X
++ a
++ }
++
++
++ {
++ X
++ Xa
++ Xa
++ XY
++ XY
++ XY
++ XZ
++ X Y
++ X Y
++ X Z
++ XX
++ XXa
++ XXY
++
++ X
++ Xa
++ Xa
++ XY
++ XY
++ XY
++ XZ
++ X Y
++ X Y
++ X Z
++ XX
++ XXa
++ XXY
++ }
++
++
++ {
++ X
++ a
++ }
++
+*** ../vim-7.2.300/src/version.c 2009-11-17 17:37:34.000000000 +0100
+--- src/version.c 2009-11-17 17:26:35.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 301,
+ /**/
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.2.302 (extra)
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.2.302 (extra part of 7.2.301)
+Problem: Formatting wrong with small 'tw' value.
+Solution: Add build rules for tests.
+Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak,
+ src/testdir/Make_ming.mak, src/testdir/Make_os2.mak,
+ src/testdir/Make_vms.mms
+
+
+*** ../vim-7.2.301/src/testdir/Make_amiga.mak 2009-09-18 14:58:26.000000000 +0200
+--- src/testdir/Make_amiga.mak 2009-11-17 15:29:05.000000000 +0100
+***************
+*** 26,32 ****
+ test48.out test51.out test53.out test54.out test55.out \
+ test56.out test57.out test58.out test59.out test60.out \
+ test61.out test62.out test63.out test64.out test65.out \
+! test66.out test67.out
+
+ .SUFFIXES: .in .out
+
+--- 26,32 ----
+ test48.out test51.out test53.out test54.out test55.out \
+ test56.out test57.out test58.out test59.out test60.out \
+ test61.out test62.out test63.out test64.out test65.out \
+! test66.out test67.out test68.out test69.out
+
+ .SUFFIXES: .in .out
+
+***************
+*** 113,115 ****
+--- 113,117 ----
+ test65.out: test65.in
+ test66.out: test66.in
+ test67.out: test67.in
++ test68.out: test68.in
++ test69.out: test69.in
+*** ../vim-7.2.301/src/testdir/Make_dos.mak 2009-09-18 14:58:26.000000000 +0200
+--- src/testdir/Make_dos.mak 2009-11-17 15:29:54.000000000 +0100
+***************
+*** 26,32 ****
+ test15.out test17.out test18.out test21.out test26.out \
+ test30.out test31.out test32.out test33.out test34.out \
+ test37.out test38.out test39.out test40.out test41.out \
+! test42.out test52.out test65.out test66.out test67.out
+
+ SCRIPTS32 = test50.out
+
+--- 26,33 ----
+ test15.out test17.out test18.out test21.out test26.out \
+ test30.out test31.out test32.out test33.out test34.out \
+ test37.out test38.out test39.out test40.out test41.out \
+! test42.out test52.out test65.out test66.out test67.out \
+! test68.out test69.out
+
+ SCRIPTS32 = test50.out
+
+*** ../vim-7.2.301/src/testdir/Make_ming.mak 2009-09-18 14:58:26.000000000 +0200
+--- src/testdir/Make_ming.mak 2009-11-17 15:30:07.000000000 +0100
+***************
+*** 45,51 ****
+ test15.out test17.out test18.out test21.out test26.out \
+ test30.out test31.out test32.out test33.out test34.out \
+ test37.out test38.out test39.out test40.out test41.out \
+! test42.out test52.out test65.out test66.out test67.out
+
+ SCRIPTS32 = test50.out
+
+--- 45,52 ----
+ test15.out test17.out test18.out test21.out test26.out \
+ test30.out test31.out test32.out test33.out test34.out \
+ test37.out test38.out test39.out test40.out test41.out \
+! test42.out test52.out test65.out test66.out test67.out \
+! test68.out test69.out
+
+ SCRIPTS32 = test50.out
+
+*** ../vim-7.2.301/src/testdir/Make_os2.mak 2009-09-18 14:58:26.000000000 +0200
+--- src/testdir/Make_os2.mak 2009-11-17 15:11:26.000000000 +0100
+***************
+*** 26,32 ****
+ test48.out test51.out test53.out test54.out test55.out \
+ test56.out test57.out test58.out test59.out test60.out \
+ test61.out test62.out test63.out test64.out test65.out \
+! test66.out test67.out
+
+ .SUFFIXES: .in .out
+
+--- 26,32 ----
+ test48.out test51.out test53.out test54.out test55.out \
+ test56.out test57.out test58.out test59.out test60.out \
+ test61.out test62.out test63.out test64.out test65.out \
+! test66.out test67.out test68.out test69.out
+
+ .SUFFIXES: .in .out
+
+*** ../vim-7.2.301/src/testdir/Make_vms.mms 2009-09-18 14:58:26.000000000 +0200
+--- src/testdir/Make_vms.mms 2009-11-17 15:11:26.000000000 +0100
+***************
+*** 69,75 ****
+ test48.out test51.out test53.out test54.out test55.out \
+ test56.out test57.out test60.out \
+ test61.out test62.out test63.out test64.out test65.out \
+! test66.out test67.out
+
+ .IFDEF WANT_GUI
+ SCRIPT_GUI = test16.out
+--- 69,75 ----
+ test48.out test51.out test53.out test54.out test55.out \
+ test56.out test57.out test60.out \
+ test61.out test62.out test63.out test64.out test65.out \
+! test66.out test67.out test68.out test69.out
+
+ .IFDEF WANT_GUI
+ SCRIPT_GUI = test16.out
+*** ../vim-7.2.301/src/version.c 2009-11-17 17:40:34.000000000 +0100
+--- src/version.c 2009-11-17 17:43:26.000000000 +0100
+***************
+*** 683,684 ****
+--- 683,686 ----
+ { /* Add new patch number below this line */
++ /**/
++ 302,
+ /**/
+
+--
+Hacker: Someone skilled in computer programming (good guy).
+Cracker: A hacker that uses his skills to crack software (bad guy).
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///