-
Notifications
You must be signed in to change notification settings - Fork 77
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
Pollution of undo history #48
Comments
You are right about pollution. It may take time to resolve this. By the time, you may disable auto add / update header using |
Yes, disabling it is an alternative, sadly I always forget to add the headers then. Another quick and unsatisfying fix, instead of checking whether the header changed, would be updating the header only once after opening the file. This can be easily done the following way: This is by no means optimal, but should be easy enough to implement and would be in my opinion an improvement to the current situation. |
Using
See |
any progress on this? i hate to be forced to disable the auto-headers :( |
It seems like Replace the autocommand with autocmd BufWritePre * silent! undojoin | :call header#update_header() " Update date when saving buffer |
First thanks for the great plug-in.
Just one thing is really annoying, every time I save the file, I get a new entry in my undo history for the change of the header. And even worse
g;
no brings me back to the header, and I am confused for a moment, as I expected to get to the line I changed last.I don't really know, how to fix this in a sane way, but I would like to propose to changes:
Check
&mod
. If I didn't modify anything, I don't want my header to show a new modified date (seems saner as the current version anyway right?). This at least gets rid of accidental multiple saves and similar.Only update the header, if it really changed. If the last changed date is already today, there is no need to update the header. With this the undo history/ last modified position would only be polluted once a day. I could easily bear with that.
The text was updated successfully, but these errors were encountered: