On 11月17日, 上午1时02分, madiyaan <
ahmadsha...@gmail.com> wrote:
> I have some questions about the MiniBufExplorer plugin:
>
> 1. How do I close buffers when using this plugin? Sometimes I open
> 10-15 buffers and I really don't want to keep all of them open so I
> use :bdelete right now. The reason for that is that I want to remove
> the buffer from the MiniBufExplorer list as well as not showing it.
> However, when I do that, the next buffer to be displayed loses it's
> syntax highlighting. I solved that problem by doing :syntax on in my
> shortcut to close the buffer (along with :bdelete), but there is
> another issue: the MiniBufExplorer window loses it's syntax
> highlighting and doesn't show me the currently active buffer in a
> different color. Have a look at this picture. The above screenshot
> shows when 3 windows were open, and the below one shows when that last
> window was closed. Notice that the MiniBufExplorer window loses color
> highlighting.
just press 'd' on tab window. lost color is because minibuf's little
bug, and you just add one line in script file:
function! <SID>AutoUpdate(delBufNum) "<<<= this is the line 1205
call <SID>DEBUG('===========================',10)
call <SID>DEBUG('Entering AutoUpdate('.a:delBufNum.') : '.bufnr
('%').' : '.bufname('%'),10)
call <SID>DEBUG('===========================',10)
if (g:miniBufExplInAutoUpdate == 1)
call <SID>DEBUG('AutoUpdate recursion stopped',9)
call <SID>DEBUG('===========================',10)
call <SID>DEBUG('Terminated AutoUpdate()' ,10)
call <SID>DEBUG('===========================',10)
return
else
let g:miniBufExplInAutoUpdate = 1
endif
" Don't bother autoupdating the MBE window
if (bufname('%') == '-MiniBufExplorer-')
" If this is the only buffer left then toggle the buffer
if (winbufnr(2) == -1)
call <SID>CycleBuffer(1)
exec 'syntax enable' " <<<<<==== add this line into script
call <SID>DEBUG('AutoUpdate does not run for cycled windows',
9)
else
call <SID>DEBUG('AutoUpdate does not run for the MBE window', 9)
endif
and you will find, it won't be lost color.