Ted cecinemapasderange wrote:

> I asked [this question] a while back on stackoverflow.com: how to get
> the source code for an anonymous VimL function.
> 
> The response that I got explained that doing e.g.
> 
>     :function {42}
> 
> would display the source code for anonymous function #42.
> 
> This is particularly useful when debugging errors or exceptions in
> anonymous functions, as the function number is the only way to
> identify the function.
> 
> However neither I nor the responder seem to be able to find the
> documentation for this feature.  Is vim intended to work this way?
> Can this command be expected to continue to function in subsequent
> versions of vim?
> 
> [this question]: http://stackoverflow.com/questions/2626137

You are not supposed to use the function number.  Use the name under
which it is stored.  E.g. for the example:

        :let mydict = {'data': [0, 1, 2, 3]}
        :function mydict.len() dict
        :   return len(self.data)
        :endfunction
        :echo mydict.len()

You can use
        :function mydict.len

-- 
A consultant is a person who takes your money and annoys your employees while
tirelessly searching for the best way to extend the consulting contract.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Reply via email to