bufexplorer icon indicating copy to clipboard operation
bufexplorer copied to clipboard

Bufexplorer MRU sort doesn't work properly if using restore_session.vim

Open dano opened this issue 10 years ago • 2 comments

I'm using a really simple plugin called restore_session that automatically calls mkview when saving a buffer or exiting vim, and then calls silent loadview when entering the buffer. This allows you to return to the exact previous cursor location of a file when you re-enter vim, along with restoring some other things like folds. However, using this plugin breaks the MRU sort in BufExplorer, because of this line:

autocmd SessionLoadPost * call s:Reset()

Every time loadview gets called (which happens whenever you enter a buffer), Reset() is called, which re-initializes the MRU list. I'm able to workaround the issue by commenting out the above line. However, I can see from the changelog that the line in question was originally added to fix a bug related to MRU sort after loading sessions. Oddly, it introduces a bug for me when loading sessions, but I'm assuming there's some other use-case that breaks without this line. I'm not sure how/if you can fix both problems at the same time, but I'll let you figure that out :)

dano avatar May 19 '14 17:05 dano

I apologize for such a delay in responding... and for the issue you are seeing...

Looks like others are having the same issue you are seeing... I will see if I can fix this. I personally do not use sessions, so someone must have asked for that to be added.

jlanzarotta avatar Nov 04 '14 04:11 jlanzarotta

I was having problems related to bufexplorer handling of the BufEnter event and was able to work around it with the eventignore option, you might be able to do something similar. Simply putting set eventignore=SessionLoadPost in your .vimrc might fix things, although it may break other stuff.

ralfthewise avatar May 30 '15 00:05 ralfthewise