69421Re: capture() function to get output of command
- May 7, 2013On 07-May-2013 05:57 +0200, mattn wrote:
>> I fully agree, it would be better if :redir could be fixed; even with myWell, okay; right now, if split() is called separately, that works out
>> proposed inclusion of split()ing into lines, the additional benefit is
>> low, and it will take a long time until plugins can fully benefit from
>> that function without a compatibility wrapper.
>> Because I'm still mostly ignorant of the Vim source code, I had assumed
>> the patch author has found fixing :redir too difficult (as it also /
>> mostly handles file and register targets where there indeed will be
>> issues with overriding); I hope mattn can shed some light on that.
> The functions in message.c write message with color attributes. So if
> splitting per line, it must get whole contents at the first.
> I guess someone want to get the contents as text which contains \n,My point is that I've *never* seen that use case so far in plugins; they
> but someone want to get the contents as array of lines. So I want to
> keep the contents as text.
all want to parse the captured output into a data structure. Do you have
any counterexample? (And for that rare use case, they could be join()'ed
back together easily.)
Any way, that built-in splitting would only be one weak counterargument
in favor of a separate capture() function. Could you make :redir work
with nested invocations instead?!
-- regards, ingo
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 vim_dev+unsubscribe@....
For more options, visit https://groups.google.com/groups/opt_out.
- << Previous post in topic Next post in topic >>