aurum / autoload / aurum / tabutils.vim

"▶1 
scriptencoding utf-8
execute frawor#Setup('0.0', {'@/resources': '0.0',})
let s:r={}
"▶1 getids
function s:F.getids(layout)
    return a:layout.top + [a:layout.bottom]
endfunction
"▶1 settoplayout
function s:r.settoplayout(layout)
    let w:aurum_winid=a:layout.top[0]
    for id in a:layout.top[1:]
        rightbelow vnew
        setlocal bufhidden=wipe
        let w:aurum_winid=id
    endfor
endfunction
"▶1 getwinnrs
function s:F.getwinnrs(ids)
    let curids={}
    call map(filter(map(range(1, winnr('$')),
                \'[getwinvar(v:val, "aurum_winid"), v:key+1]'),
                \'!empty(v:val[0])'),
                \'extend(curids, {v:val[0]: v:val[1]})')
    return map(copy(a:ids), 'get(curids, v:val, 0)')
endfunction
"▶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
    else
        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)
    endif
endfunction
"▶1 Post resource
call s:_f.postresource('tabutils', s:r)
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 ProjectModifiedEvent.java.
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.