To: vim-dev@vim.org Subject: Patch 6.1.329 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.329 Problem: When editing a file "a b c" replacing "%" in ":Cmd %" or ":next %" does not work properly. (Hari Krishna Dara) Solution: Always escape spaces when expanding "%". Don't split argument for in a user command when only one argument is used. Files: src/ex_docmd.c *** ../vim61.328/src/ex_docmd.c Sat Feb 1 16:43:17 2003 --- src/ex_docmd.c Sun Feb 16 22:07:15 2003 *************** *** 3196,3205 **** continue; } ! #ifdef UNIX ! /* For Unix there is a check for a single file name below. Need to ! * escape white space et al. with a backslash. */ ! if ((eap->argt & NOSPC) && !eap->usefilter) { char_u *l; --- 3203,3217 ---- continue; } ! /* Need to escape white space et al. with a backslash. Don't do this ! * for shell commands (may have to use quotes instead). Don't do this ! * for non-unix systems when there is a single argument (spaces don't ! * separate arguments then). */ ! if (!eap->usefilter ! #ifndef UNIX ! && !(eap->argt & NOSPC) ! #endif ! ) { char_u *l; *************** *** 3215,3221 **** break; } } - #endif /* For a shell command a '!' must be escaped. */ if ((eap->usefilter || eap->cmdidx == CMD_bang) --- 3227,3232 ---- *************** *** 4591,4596 **** --- 4602,4612 ---- break; } + /* When specified there is a single argument don't split it. + * Works for ":Cmd %" when % is "a b c". */ + if ((eap->argt & NOSPC) && quote == 2) + quote = 1; + switch (quote) { case 0: /* No quoting, no splitting */ *** ../vim61.328/src/version.c Sun Feb 16 22:03:39 2003 --- src/version.c Sun Feb 16 22:05:05 2003 *************** *** 608,609 **** --- 612,615 ---- { /* Add new patch number below this line */ + /**/ + 329, /**/ -- hundred-and-one symptoms of being an internet addict: 269. You receive an e-mail from the wife of a deceased president, offering to send you twenty million dollar, and you are not even surprised. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///