On 3 November 2013, ZyX <[email protected]> wrote:
> Currently if you care about preserving NULs in buffers in many cases
> you have to write bad hacks. Particularly, you cannot distinguish NULs
> and NLs in
>
> 1. submatch(). Fixed by this patch by adding second optional argument
> that makes submatch() return a list.

[...]
> -submatch({nr})                                               *submatch()*
> +submatch({nr}[, {list}])                             *submatch()*
>               Only for an expression in a |:substitute| command or
>               substitute() function.
>               Returns the {nr}'th submatch of the matched text.  When {nr}
>               is 0 the whole matched text is returned.
>               Also see |sub-replace-expression|.
> +
> +             If {list} is present and non-zero then submatch() returns 
> +             a list of strings, similar to |getline()| with two arguments. 
> +             Only makes difference for |:substitute|: inside |substitute()| 
> +             this list will always contain one or zero items.
> +
[...]

    It's a great idea to address this issue, but in my opinion the
documentation can be improved. :) It should be explained what said list
consist of, and I think the reference to getline() is confusing at best.

    /lcd

-- 
-- 
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 because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui