diff options
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index a47342a3f5..330b3b98f6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -218,6 +218,10 @@ open_buffer( return FAIL; } + // Do not sync this buffer yet, may first want to read the file. + if (curbuf->b_ml.ml_mfp != NULL) + curbuf->b_ml.ml_mfp->mf_dirty = MF_DIRTY_YES_NOSYNC; + // The autocommands in readfile() may change the buffer, but only AFTER // reading the file. set_bufref(&old_curbuf, curbuf); @@ -298,6 +302,11 @@ open_buffer( retval = read_buffer(TRUE, eap, flags); } + // Can now sync this buffer in ml_sync_all(). + if (curbuf->b_ml.ml_mfp != NULL + && curbuf->b_ml.ml_mfp->mf_dirty == MF_DIRTY_YES_NOSYNC) + curbuf->b_ml.ml_mfp->mf_dirty = MF_DIRTY_YES; + // if first time loading this buffer, init b_chartab[] if (curbuf->b_flags & BF_NEVERLOADED) { |