On save, only unset 'modified' for the current filename

If the buffer is being saved to a different filename, then this buffer
should still be modified as its backing file is still different than the
buffer.

Signed-off-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
James McCoy 2017-10-22 23:21:58 -04:00
parent d3453145c5
commit c411e61aeb
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -761,7 +761,9 @@ function s:GPGEncrypt()
endif
if auType == 'BufWrite'
if expand('%:p') == filename
setl nomodified
endif
setl buftype=acwrite
let &readonly = filereadable(filename) && filewritable(filename) == 0
endif