Hi, I attach a patch (against svn revision 1889) and four test files. Some test patterns are recognized as binary by diff. So I attached them separately.
The following is a brief explanation of this patch. == Since the patch 7.2.407 was applied, the backslash in the expression is not consumed but kept. For example, "\<CR>" in the expression results in a backslash followed by a line break and two backslashes "\\" in the expression results in two backslashes. See *sub-replace-expression*. Since the patch 7.2.407 and 7.2.437 was applied, "\<NL>" in the expression results in not real <NL> character but a backslash followed by a line break. See *sub-replace-expression*. The description about the notation '\=' used in the third argument of substitute() is added. See *sub-replace-expression*. The description about the special characters used in the third argument of substitute() is added. See *sub-replace-special*. The description about "%" used in the third argument of substitute() is added. See *:s%*. The description about submatch() used in substitute() is added. See *submatch()*. Regards, Motoya Kurotsu 2011/3/20 Motoya Kurotsu <[email protected]>: > Hi, > >> Thank for the patch. How about adding a test? > > I would post the patch as soon as possible. > > Motoya Kurotsu > > 2011/3/18 Bram Moolenaar <[email protected]>: >> >> Motoya Kurotsu wrote: >> >>> The patch is attached. Please check and correct. >>> >>> I deleted the following expression in >>> *sub-replace-expression* because the function has been lost >>> since Patch 7.2.437. >>> >>> Prepend a backslash to get a real <NL> character (which will be >>> a NUL in the file). >>> >>> I added the description that "\=" notation is valid in not only >>> :substitute command but also substitute() function. >>> >>> I also added the description that submatch() is valid in not only >>> :substitute command but also substitute() function because the >>> code seems to work so. I'm not sure why :help submatch() insists >>> on "Only for an expression in a :substitute command". Since the >>> introduction of submatch() in eval.c (vim-6.0d or CVS revision 1.12), >>> it seems to have worked with the first level substitute() such like >>> the following. >>> >>> let y = substitute("hello", '\l', '\=toupper(submatch(0)), "g") >> >> Thank for the patch. How about adding a test? >> >> -- >> Citizens are not allowed to attend a movie house or theater nor ride in a >> public streetcar within at least four hours after eating garlic. >> [real standing law in Indiana, United States of America] >> >> /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ >> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ >> \\\ an exciting new programming language -- http://www.Zimbu.org /// >> \\\ help me help AIDS victims -- http://ICCF-Holland.org /// >> >> -- >> You received this message from the "vim_dev" maillist. >> Do not top-post! Type your reply below the text you are replying to. >> For more information, visit http://www.vim.org/maillist.php >> > -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
test71.in
Description: Binary data
test72.in
Description: Binary data
test71.ok
Description: Binary data
test72.ok
Description: Binary data
regexp.c.patch
Description: Binary data
