Source

aurum / autoload / aurum / record.vim

Diff from to

File autoload/aurum/record.vim

         call repo.functions.strip(repo)
     endif
     call map(files, 'repo.functions.reltorepo(repo, v:val)')
-    tabnew
-    setlocal bufhidden=wipe
-    let t:aurum_tabid='AuRecordTab'
-    call s:_r.tabutils.settoplayout(s:layout)
     let sopts={'record': 1}
     if !empty(files)
         let sopts.files=files
     endif
-    call s:_r.run('silent botright '.s:F.getswheight().'split', 'status',
-                \ repo, sopts)
-    setlocal bufhidden=wipe
-    let w:aurum_winid='AuRecordStatus'
+    call s:_f.tab.create(s:layoutname, s:_r.run, ['status', repo, sopts])
     setlocal nomodifiable
     call s:_f.mapgroup.map('AuRecord', bufnr('%'))
     let bvar=s:_r.bufvars[bufnr('%')]
         endif
     endif
 endfunction
+"▶1 tabunload
+function s:F.tabunload()
+    let [lwnr, rwnr, swnr]=s:F.getwnrs()
+    execute swnr.'wincmd w'
+    let bvar=s:_r.bufvars[bufnr('%')]
+    return s:F.unload(bvar)
+endfunction
 "▶1 unload
 function s:F.unload(bvar)
     let sbvar=get(a:bvar, 'sbvar', a:bvar)
     augroup END
 endfunction
 "▶1 getwnrs
-let s:layout={
+function s:F.getwnrs()
+    return s:_f.tab.getwnrs(s:layoutname)
+endfunction
+"▶1 register layout
+let s:layoutname='AuRecordTab'
+call s:_f.tab.new(s:layoutname, {
             \   'top': ['AuRecordLeft', 'AuRecordRight'],
             \'bottom': 'AuRecordStatus',
-            \'bottomheightfun': s:F.getswheight,
-        \}
-function s:F.getwnrs()
-    return s:_r.tabutils.getwnrs(s:layout)
-endfunction
+        \}, s:F.getswheight, s:F.tabunload)
 "▶1 edit
 let s:savedopts=['readonly', 'modifiable', 'scrollbind', 'cursorbind',
             \    'scrollopt', 'wrap', 'foldmethod', 'foldcolumn']