comparison 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
comparison
equal deleted inserted replaced
6984:de7f5b566064 6985:a07c3f9cd616
802 802
803 /* Make a difference between the first buffer and every other. */ 803 /* Make a difference between the first buffer and every other. */
804 for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new) 804 for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new)
805 { 805 {
806 buf = curtab->tp_diffbuf[idx_new]; 806 buf = curtab->tp_diffbuf[idx_new];
807 if (buf == NULL) 807 if (buf == NULL || buf->b_ml.ml_mfp == NULL)
808 continue; 808 continue; /* skip buffer that isn't loaded */
809 if (diff_write(buf, tmp_new) == FAIL) 809 if (diff_write(buf, tmp_new) == FAIL)
810 continue; 810 continue;
811 diff_file(tmp_orig, tmp_new, tmp_diff); 811 diff_file(tmp_orig, tmp_new, tmp_diff);
812 812
813 /* Read the diff output and add each entry to the diff list. */ 813 /* Read the diff output and add each entry to the diff list. */