aurum / autoload / aurum / tabutils.vim

scriptencoding utf-8
execute frawor#Setup('0.0', {'@/resources': '0.0',})
let s:r={}
"▶1 getids
function s:F.getids(layout)
    return + [a:layout.bottom]
"▶1 r.settoplayout
function s:r.settoplayout(layout)
    for id in[1:]
        rightbelow vnew
        setlocal bufhidden=wipe
        let w:aurum_winid=id
"▶1 getwinnrs
function s:F.getwinnrs(ids)
    let curids={}
    call map(filter(map(range(1, winnr('$')),
                \'[getwinvar(v:val, "aurum_winid"), v:key+1]'),
                \'extend(curids, {v:val[0]: v:val[1]})')
    return map(copy(a:ids), 'get(curids, v:val, 0)')
"▶1 r.getwnrs
" layout: {
"   "top": [id],
"   "bottom": id,
"   "bottomheightfun": () → N,
" }
" r: [topid] + [bottomid]
function s:r.getwnrs(layout)
    let r=[]
    let ids=s:F.getids(a:layout)
    let winnrs=s:F.getwinnrs(ids)
    if winnrs[0] is 0 || index(winnrs, 0)==-1
        return winnrs
        execute winnrs[-1].'wincmd w'
        silent only!
        topleft new
        call s:r.settoplayout(a:layout)
        wincmd j
        execute 'resize' call(a:layout.bottomheightfun, [], {})
        return s:F.getwinnrs(ids)
"▶1 Post resource
call s:_f.postresource('tabutils', s:r)
call frawor#Lockvar(s:, '_r,_pluginloaded')
" vim: ft=vim ts=4 sts=4 et fmr=▶,▲
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.