frawor / test / rtp / plugin / wrapfunc-alter-special-variables.vim

ZyX_I 3f70121 
ZyX_I 9bef657 
ZyX_I 72cdd74 

ZyX_I 73e175d 

ZyX_I 72cdd74 

execute frawor#Setup('0.0', {'@/functions': '0.0',
            \     '@/decorators/altervars': '0.0'})
function s:F.getvars(v)
    let r=[]
    let d=eval(a:v)
    for varname in sort(keys(d))
        call add(r, a:v.varname.': '.string(d[varname]))
    return r
function s:F.wrappedfunc(...)
    let g:outfile='xxx'
    let g:xxx_new_var=['abc']
    let b:xxx_new_var=0
    let w:xxx_new_var=1
    unlet g:testfile
    let r=s:F.getvars('g:')+s:F.getvars('b:')+s:F.getvars('w:')
    call add(r, 'args: ('.string(a:000)[1:-2].')')
    call WriteFile(r)
call s:_f.addextfunctions({'Function': {'function': s:F.wrappedfunc,
            \                         '@altervars': [['+variables'],
            \                                        ['+variables(b)', {'xxx_new_var_2': 0}],
            \                                        ['+variables(w)']]}})
call WriteFile(s:F.getvars('g:')+s:F.getvars('b:')+s:F.getvars('w:'))
call WriteFile('>>>')
call Function()
call WriteFile('<<<')
call WriteFile(s:F.getvars('g:')+s:F.getvars('b:')+s:F.getvars('w:'))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.