Am 01.05.2013 14:11, schrieb mattn:
Yes, I know.

Probably a nice addition, but one can already do all of this in
vimscript, see attachment.  In your example, replace capture() with
StrRedir().

No, it can't. It depend on your vim script. We want to get the result
without side effect.

---------------------------------
function! s:bar()
   let a = ''
   redir => a
   call thirdparty#library#function()
   redir END
   return a
endfunction

echo s:bar()
---------------------------------

Do you know the wheather thirdparty#library#function() call redir? or
not?  I don't think all of vim script like the
thirdparty#library#function() call your Redir function.

Yep, all code is required to use StrRedir().  There could be an autoload
script shipped with Vim which does the same as StrRedir(), and the help
for :redir could contain a recommendation to use it.  But this still
doesn't help existing code.

+1 for capture(), just wanted to point out an existing solution.

--
Andy

--
--
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