907th/vim-auto-save

don't touch file if no changes has been made

graph opened this issue · 2 comments

graph commented

Since I have enabled this pluggin in vim 8.0 just looking at some files causes timestamps to be updated. This means various compilation occur needlessly for me. There should be a check that the file has actually changed when saving. I have setup the plugin with CursorHold & CursorHoldI, I don't know if that matters.

Thank you.

I don't know very well the vim language. It looks like it it does check if file was modified but calls save regardless

https://github.com/907th/vim-auto-save/blob/master/plugin/AutoSave.vim#L74

perhaps that line should be in the if block checking if it was modified.

907th commented

@graph That really makes sense! Thank you! I will try to fix.

907th commented

@graph I've just updated a master branch. It should now fix your issue. Could you please download it and test if it works for you?