Mercurial > vim
comparison src/fileio.c @ 3036:df33dba4e553 v7.3.290
updated for version 7.3.290
Problem: When a BufWriteCmd autocommand resets 'modified' this doesn't
change older buffer states to be marked as 'modified' like
":write" does. (Yukihiro Nakadaira)
Solution: When the BufWriteCmd resets 'modified' then adjust the undo
information like ":write" does.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 02 Sep 2011 11:56:20 +0200 |
parents | cb4682b95909 |
children | 539613ce999d |
comparison
equal
deleted
inserted
replaced
3035:ba9f075a347d | 3036:df33dba4e553 |
---|---|
3340 apply_autocmds_exarg(EVENT_FILTERWRITEPRE, | 3340 apply_autocmds_exarg(EVENT_FILTERWRITEPRE, |
3341 NULL, sfname, FALSE, curbuf, eap); | 3341 NULL, sfname, FALSE, curbuf, eap); |
3342 } | 3342 } |
3343 else if (reset_changed && whole) | 3343 else if (reset_changed && whole) |
3344 { | 3344 { |
3345 if (!(did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD, | 3345 int was_changed = curbufIsChanged(); |
3346 sfname, sfname, FALSE, curbuf, eap))) | 3346 |
3347 did_cmd = apply_autocmds_exarg(EVENT_BUFWRITECMD, | |
3348 sfname, sfname, FALSE, curbuf, eap); | |
3349 if (did_cmd) | |
3350 { | |
3351 if (was_changed && !curbufIsChanged()) | |
3352 { | |
3353 /* Written everything correctly and BufWriteCmd has reset | |
3354 * 'modified': Correct the undo information so that an | |
3355 * undo now sets 'modified'. */ | |
3356 u_unchanged(curbuf); | |
3357 u_update_save_nr(curbuf); | |
3358 } | |
3359 } | |
3360 else | |
3347 { | 3361 { |
3348 #ifdef FEAT_QUICKFIX | 3362 #ifdef FEAT_QUICKFIX |
3349 if (overwriting && bt_nofile(curbuf)) | 3363 if (overwriting && bt_nofile(curbuf)) |
3350 nofile_err = TRUE; | 3364 nofile_err = TRUE; |
3351 else | 3365 else |