Hi!

On Fri, May 16, 2014 at 12:53:17PM +0400, Nikolay Pavlov wrote:
> On May 16, 2014 12:29 PM, "Alex Efros" <[email protected]> wrote:
> > > >     fun s:Foo()
> > > >     endfun
> > > >     let g:Foo = function('s:Foo')
> This change has nothing to do with the change that made function('s:...')
> work outside of the plugin which defined this funcref. It was a bug that
> got fixed.

User reported it on Ubuntu 12.04 LTS with Vim 7.3.429-2ubuntu2.1, I see it
on 7.3.762 - so, this bug exists in so many vim versions?

> To workaround it on old vims you should use manually replace s: with
> <SNR>N_ when defining funcrefs. AFAIR :h <SID> shows some ways to get N.

You mean I should add

    function s:SID()
            return matchstr(expand('<sfile>'), '\zs<SNR>\d\+_\zeSID$')
    endfunction

into each file of my plugin (it uses sort of sub-plugins in separate
files, so there a lot of them), and then replace in each file each

    let g:Foo = function('s:Foo')

with

    let g:Foo = function(s:SID().'Foo')

And this is only way to keep compatibility with these vim versions?

-- 
                        WBR, Alex.

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui