简体   繁体   English

MiniBufExplorer和NERD_Tree关闭缓冲意外行为

[英]MiniBufExplorer and NERD_Tree closing buffers unexpected behavior

I have MiniBufExplorer and NERDTree installed. 我安装了MiniBufExplorer和NERDTree。 With a NERDTree window open at the same time as MiniBufExplorer with >2 editable buffers, closing one of the buffers with :bd causes the buffer to empty but the window to show the empty buffer and not one of the next or previous buffers. 在NERDTree窗口与MiniBufExplorer同时打开并具有> 2个可编辑缓冲区的情况下,使用:bd关闭其中一个缓冲区会导致缓冲区为空,但窗口显示空缓冲区而不是下一个或上一个缓冲区之一。 Also, the buffer just closed still shows up as selected in the MBE list. 此外,刚刚关闭的缓冲区仍显示为MBE列表中的选定内容。 The layout of the windows when I perform this are as follows: (N - NerdTree, M - MiniBufExpl, D - Document window) 执行此操作时窗口的布局如下:(N - NerdTree,M - MiniBufExpl,D - 文档窗口)

NNN MMMMMM
NNN DDDDDD
NNN DDDDDD
NNN DDDDDD

Any suggestions as to what might be the problem? 关于可能出现什么问题的任何建议?

I'm not sure if this will resolve all your issues, but I had similarly screwy behaviour with minibufexplorer/NERDTree, and found that Vim Tip 165 's bclose function cured most of the faults - especially with a mapping I stole from Gary Bernhardt's .vimrc to remap the :bd command appropriately: 我不确定这是否会解决你所有的问题,但我对minibufexplorer / NERDTree也有类似的麻烦行为,并且发现Vim Tip 165的bclose函数可以解决大多数错误 - 特别是我从Gary Bernhardt那里偷走了一个映射。 vimrc适当地重新映射:bd命令:

" GRB: use fancy buffer closing that doesn't close the split
cnoremap <expr> bd (getcmdtype() == ':' ? 'Bclose' : 'bd')

:bd works for me (vim 7.2, mbe 6.3.2). :bd对我有用(vim 7.2,mbe 6.3.2)。 it is closing the current buffer, removing it from mbe's buffer list, and opening another one. 它正在关闭当前缓冲区,将其从mbe的缓冲区列表中删除,然后再打开另一个缓冲区。 only the last part - opening another buffer - seems to be a little unpredictable: sometimes it's the buffer to the right, sometimes the one to the left, and sometimes still another one. 只有最后一部分 - 打开另一个缓冲区 - 似乎有点不可预测:有时它是右边的缓冲区,有时是左边的缓冲区,有时是另一个缓冲区。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM