-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RO] buffers of netrw don’t get closed #13
Comments
Yep, this is one of the most maddening behaviors of netrw. I actually have a hack in my vimrc to kill these buffers, but I haven't settled on whether it causes any side effects in netrw: https://github.com/justinmk/config/blob/59b064bb9433449d308b7b889922e2d1c77a30c5/.vimrc#L662 To be clear, netrw sometimes leaves its buffers marked as |
This isn't related to vim-vinegar. I've seen this before installing it. I've fixed it by removing these 3 lines from my vimrc https://github.com/edkolev/dots/blob/2ade8ec0d427d7d0b087379239f0d893276ec1f9/vimrc#L297-L299 Not sure which one of them was causing the misbahavior |
Well treeview ( |
I get the same thing, but I found that I could use |
this still happens to me a lot. anybody come up with a solid workaround? |
Only slightly better is if you have a buffer manager (I user buffergator) you can usually mark buffers for deletion from that popup window. I choose the buffer in the buffergator window, press d, and move on to the next one that needs deleting. Works similar to emacs in that regard. |
This workaround seems to help:
At least since I added this to vimrc I don't remember to have this problem. |
|
I'll be glad if someone provide working solution.. Those stuck netrw buffers is freaking me out :( |
@wedens I've been navigating away from open netrw buffers with |
There has to be a better way than these convolusions. What about
|
@tpope that didn't work for me. I still get netrw buffers listed (ones with |
Can you check and make sure |
|
On my box, netrw remains hidden to the native vim buffer-lists, but for some reason |
I recommend |
Thanks @justinmk going to give that a try because buffers are still not getting closed. I dug a little deeper and when I manually open up netrw, the buffers don't show up, but if I use vinegar they do. |
This is very annoying. I've tried to find what causes this bug without any luck. |
I just ended up just using netrw without vinegar because this bug was so annoying. |
I switched to filebeagle also (https://github.com/jeetsukumaran/vim-filebeagle). It's just like netrw+vinegar, but faster and without this bug. |
@dnr I tried filebeagle, but it didn't have a way to create directories or delete files, which is important to me |
Adding this to
However, this worked partially for me:
The first buffer used by NetRW would stick around. But all subsequent NetRW buffers get wiped by this command. |
Both additions should fall flat because netrw resets &bufhidden in |
try |
Vinegar has this annoying habit of leaving the file listing buffer open, which pollutes Vim's buffer list. There is a debate as to whether it is vinegar's or netrw's fault [1], but regardless, it's a problem that still hasn't been fixed. filebeagle does not have this issue and operates in nearly the same way as vinegar, so I'm going to start using that instead. [1] tpope/vim-vinegar#13
What ever happened to this? I still seem to have this bug happening. |
I am still getting this bug as well |
I encountered this most when attempting to close all my currently open buffers with something like |
for me it was treeview. removing |
I'm having a similar problem; I made a video of the entire process: It doesn't seem to have anything to do with vinegar or how many buffers I have open; however, when I create a split window and open netrw, that window becomes "locked" in read-only ( @tpope, sorry to pollute your plugin with this as I know it is a netrw problem and not a Vinegar problem - but any ideas how to fix this? |
I found that if I have |
This thing is incredibly annoying...and using vim-startify I store in my sessions those pending netrw windows too! |
Having |
I don't use Vinegar (as of yet), and I happened upon this issue on my own just using native netrw commands. I almost strictly use netrw feature ':Lex(plore)', and I just noticed yesterday that it has been adding these 'orphan' buffers to the window. the suggested augroup fix seems to stunt it to a one to one amount (so two if you happen to have multiple explorers open, which a completely different issue I'm suffering from using netrw/Lexplore), and just one orphan if all explorers are 'closed'. But now :Rex has been pretty usuable, I just get an error message "warning (netrw) win#1 not a former netrw window". I thought this might be useful information here, it seems that many might think this is a Vinegar, but I think my experiences may indicate it's a bit deeper. |
the workaround that has worked for me has been: adding this to my .vimrc " Remove 'set hidden'
set nohidden And then setting augroup netrw_buf_hidden_fix
autocmd!
" Set all non-netrw buffers to bufhidden=hide
autocmd BufWinEnter *
\ if &ft != 'netrw'
\| set bufhidden=hide
\| endif
augroup end By doing this, you can do |
Any idea what broke this? |
@spacepluk, I think it has to do with netrw and how it handles the bufhidden and whatnot, as well as the settings it imposes on the buffers it creates and how it handles switching to other buffers. This is not a vim-vinegar issue, this is a netrw issue I think, as I've been able to reproduce the problem with no plugins whatsoever other than the ones that ship with vim. |
@slashfoo I tried reverting |
Bug very easily reproduced in vim 8.0.1386 on mac os x:
|
Add experimental workaround to remove netrw buffers from the buffer list. This happens when using vinegar to navigate the directory of the current file: the netrw buffers may stick around unclosed [1], or the first netrw buffer will be part of the list of buffers [2]. It is annoying to navigate buffers with buffergator or ctrlp when there are several netrw buffers listed along with the open files. Try setting the bufhidden option to delete the netrw buffers, and use a custom function to delete that first netrw buffer that is not removed just by setting bufhidden. [1] tpope/vim-vinegar#13 [2] tpope/vim-vinegar#74
Add experimental workaround to remove netrw buffers from the buffer list. This happens when using vinegar to navigate the directory of the current file: the netrw buffers may stick around unclosed [1], or the first netrw buffer will be part of the list of buffers [2]. It is annoying to navigate buffers with buffergator or ctrlp when there are several netrw buffers listed along with the open files. Try setting the bufhidden option to delete the netrw buffers, and use a custom function to delete that first netrw buffer that is not removed just by setting bufhidden. [1] tpope/vim-vinegar#13 [2] tpope/vim-vinegar#74
Up. |
Came across this issue in my search for finding out how to get netrw buffers to close themselves. I had to set |
@BlakeWilliams Thanks! That works perfectly. |
... and don't ever show the netrw buffer in the buffer list. tpope/vim-vinegar#13
This seems to have worked for me 🤞 |
In my case I had to remove the following line
which was conflicting with |
I found a strange behavior in using vim-vinegar. After a while the buffers opened by "-" don’t get closed any more and stick around (so there might be a dozen buffers with netrw trees open). It’s not possible to close them at all. Not with
:bd
,:q
or even:!bd
,!q
. The only way to exit vim is to kill it or close the tmux window.I get this error repeated when trying to close such a buffer:
This may be a conflict with some other plugins, but deactivating some plugins which handle buffers like Ctrl-P didn’t help.
The text was updated successfully, but these errors were encountered: