Detailed view of a page, which is probably more useful for debugging than anything else.
get_pagedata('DontCloseMyWindow') | |
_cached_html | transformedtext Object ( [_type] => pagetype_wikitext Object ( ) [_basepage] => DontCloseMyWindow [_content] => Array ( [0] => <div class="wikitext"><h3>Challenge</h3> <p class="tightenable top">When you have several windows laid out, and you use :bd, the window containing the buffer is closed; make it not do that. The behavior should be the same as using :bd when there is only one window.</p> <p class="tightenable">Required</p> <ul><li class="tightenable bottom">If there are other buffers, edit one of them (I'm not sure what algo Vim uses for that).</li> <li class="tightenable top">If it's the last buffer, replace with a new, empty buffer.</li> </ul> <p class="tightenable">Bonus</p> <ul><li class="tightenable">Add an option for minibufexpl.vim with the effect that only "eligible buffers" will be used</li> </ul> <hr /> <h3>Solutions</h3> <pre class="tightenable top"> " :Bd <buffernum> - by FallingCow command! -bang -nargs=? Bd call <Sid>BDel('<bang>', <args>) function! <Sid>BDel(bang, ...) let curbuf = (a:0 ? a:1 : winbufnr(0)) if (winbufnr(2) != -1) " Find buffer to move to let otherbuf = 1 while otherbuf <= bufnr('$') && (!buflisted(otherbuf) || !getbufvar(otherbuf, '&modifiable') || otherbuf == curbuf) let otherbuf = otherbuf + 1 endwhile if otherbuf > bufnr('$') enew let otherbuf = winbufnr(0) endif " Loop through windows looking for buffer to be removed while bufwinnr(curbuf) != -1 exe "norm " . (bufwinnr(curbuf)) . "\<C-W>\<C-W>" exe "b" . otherbuf endwhile endif " Delete old buffer exe "bd" . a:bang . " " . curbuf endfunction</pre> <hr /> <p class="tightenable top bottom">Sorry for spoiling the party, but i don't see the sense of rule 2. So here's what i use: [1] => cached_wikilink Object ( [_page] => DeleteBufferButHoldWindowOpen ) [2] => (It closes the window on the second last buffer) -- yahvu</p> </div> ) [_description] => When you have several windows laid out, and you use :bd, the window containing the buffer is closed; make it not do that. The behavior should be the same as using :bd when there is only one window. ) |
hits | 2290 |
get_versiondata('DontCloseMyWindow',20) | |
%content | !!Challenge When you have several window ... |
author | 85.181.242.28 |
author_id | 85.181.242.28 |
is_minor_edit | |
markup | 2 |
mtime | 1193679370 |
pagetype | wikitext |
summary | noncompetitive spoiler |
get_versiondata('DontCloseMyWindow',19) | |
%content | !!Challenge When you have several window ... |
_supplanted | 1193679370 |
author | 193.71.180.107 |
author_id | 193.71.180.107 |
is_minor_edit | |
markup | 2 |
mtime | 1193661116 |
pagetype | wikitext |
get_versiondata('DontCloseMyWindow',18) | |
%content | !!Challenge When you have several window ... |
_supplanted | 1193661116 |
author | WikiWord |
author_id | WikiWord |
is_minor_edit | |
markup | 2 |
mtime | 1186728100 |
pagetype | wikitext |
get_versiondata('DontCloseMyWindow',13) | |
%content | !!Challenge When you have several window ... |
_supplanted | 1183076229 |
author | metacosm |
author_id | metacosm |
is_minor_edit | |
markup | 2 |
mtime | 1100238149 |
pagetype | wikitext |