Wednesday, December 26, 2012

Re: Capture output of command line completion in script

Hi ZyX!

On Mi, 26 Dez 2012, ZyX wrote:

> > Right. But shouldn't :redir also be useable to capture all available
> > completions? We can still think about adding another completion
> > vimscript function for returning all matches.
>
> There is already a workaround:
> https://github.com/paradigm/SkyBison/blob/eda32bb644fd0651679121dca11e41088dafc94b/plugin/skybison.vim#L141-L152
> . Why do we need :redir? If a function for capturing completions is added :redir support becomes more pointless then now when workaround exists.
>
> I would really like a function anywhere I have to use :redir now and purge out :redir from my and others' people code: parsing back data that was structured and could be output as a complex structure instead of text by some function is already bad. But with "no nested redirections" rule you never know when you will have a problem with :redir and encouraging people to use it by adding support for this is just bad.
>
> Completion scripts may and some in fact *will* use :redir: I see no other way to get the list of functions and thus had to use this workaround. Using :redir to capture completion variants may result in these functions being broken and *will* result in the outer function requesting completion variants being broken.

This just looks like another ugly workaround, not better then using
:redir


Mit freundlichen Grüßen
Christian
--
Dies ist die Probe, wie hoch man einen andern Menschen stelle und
liebe, inwieweit man von ihm in Rücksicht der Glücksgüter abhängig
sein will. Nur dies Gefühl entscheidet über die Ansicht fremden
Gehalts.
-- Jean Paul

--
You received this message from the "vim_use" 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

No comments: