Hi, 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")
Regards,
Motoya Kurotsu
2011/3/17 motz <[email protected]>:
> Please ignore this reply, sorry.
>
> On 3月14日, 午前8:42, motz <[email protected]> wrote:
>> Hi,
>>
>> I would. But English is not my native language. So I hope that
>> someone would check and correct.
>>
>> In Japan or at Tokyo, the periodical blackout is planned from
>> the effect of the earthquake. So it may take a while to post the
>> patch. But I would do so as possible as I can.
>>
>> Regards,
>>
>> Motoya Kurotsu
>>
>> On 3月12日, 午前4:34, Bram Moolenaar <[email protected]> wrote:
>>
>> > Ben Schmidt wrote:
>> > > > I would like to propose a patch which suppresses the conversion of
>> > > > <NL> to<CR> when evaluaation ('\=') is used inside substitute()
>> > > > function.
>> > > > Simply this patch is what makes x == y true in the following code.
>>
>> > > > let x = substitute('a', '.', "\n", "")
>> > > > let y = substitute('a', '.', '\="\n"', "")
>>
>> > > Regardless of whether the functionality change of the patch is accepted,
>> > > I think there should be a change to :help sub-replace-expression to
>> > > explain what is done when \= is used within substitute().
>>
>> > Can someone propose a patch?
>>
>> > --
>> > Why isn't there mouse-flavored cat food?
>>
>> > /// 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
regexp.c.patch
Description: Binary data
