I've been having an issue with buffers changing their content when I switch between them with :bNext and :bPrevious, assuming that :set hidden is on. This scenario is perfectly reproducible:
Load two or more files, make a change in file A, :bNext to a different
file, then back to file A. The file will have gotten an empty line added
after the last place of editing (regardless of whether I saved before or
not). If I then switch back and forth, there's no change, but the empty
line is there.
Another symptom, that I don't know exactly when it happens but I know
happens regularly, would be the exact same situation as before, but
instead of a new empty line, the latest edited state is undo'd a step or
two backwards (this also regardless of whether I saved or not).
After disabling things one by one in my .vimrc and disabling all of my
plugins, I narrowed it down to the point that I found out that these two
lines were what caused the issue:
au BufWinLeave ?* mkview
au BufWinEnter ?* silent loadview
These lines were taken from this page:
http://vim.wikia.com/wiki/Make_views_automatic
The purpose was to make folds get saved. Obviously this side effect of
buffers behaving strangely is something that gets in my way though, and
I think I prefer having a working buffer switching instead of saved
folds, but optimally I'd like to have both.
Does anyone know if there's a way around this issue?
signature.asc
Description: OpenPGP digital signature
