Skip to content
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

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

Open
dano opened this issue May 19, 2014 · 3 comments
Open

Comments

@dano
Copy link

dano commented May 19, 2014

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 :)

@jlanzarotta
Copy link
Owner

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.

@ralfthewise
Copy link

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.

@drmikehenry
Copy link
Contributor

I believe I see a way to adjust the MRU buffer tracking to address this issue (along with #87). I'd like to mull over the idea some more and hopefully have a pull request to consider, as hobby time permits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants