diff src/diff.c @ 6985:a07c3f9cd616 v7.4.810

patch 7.4.810 Problem: With a sequence of commands using buffers in diff mode E749 is given. (itchyny) Solution: Skip unloaded buffer. (Hirohito Higashi)
author Bram Moolenaar <bram@vim.org>
date Tue, 04 Aug 2015 21:51:25 +0200
parents d3a23af4bba1
children 96d5dd9e7bc9
line wrap: on
line diff
--- a/src/diff.c
+++ b/src/diff.c
@@ -804,8 +804,8 @@ ex_diffupdate(eap)
     for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new)
     {
 	buf = curtab->tp_diffbuf[idx_new];
-	if (buf == NULL)
-	    continue;
+	if (buf == NULL || buf->b_ml.ml_mfp == NULL)
+	    continue; /* skip buffer that isn't loaded */
 	if (diff_write(buf, tmp_new) == FAIL)
 	    continue;
 	diff_file(tmp_orig, tmp_new, tmp_diff);