summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-04-05 20:41:53 +0000
committerBram Moolenaar <Bram@vim.org>2006-04-05 20:41:53 +0000
commit910f66f90c928da8b607ccfdc12fc33d9cb8d4a9 (patch)
tree152a03d1d7ea3e8d433addba4f463d8a7a68a5fd /src/diff.c
parente2f98b95c8071f772695602cd4f714dc588eb8e7 (diff)
updated for version 7.0c10v7.0c10
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/diff.c b/src/diff.c
index 3927338340..f02aa5ef27 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1000,7 +1000,8 @@ ex_diffpatch(eap)
#ifdef FEAT_AUTOCMD
/* Do filetype detection with the new name. */
- do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
+ if (au_has_group((char_u *)"filetypedetect"))
+ do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
#endif
}
}
@@ -2056,6 +2057,19 @@ ex_diffgetput(eap)
aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]);
}
+ /* May give the warning for a changed buffer here, which can trigger the
+ * FileChangedRO autocommand, which may do nasty things and mess
+ * everything up. */
+ if (!curbuf->b_changed)
+ {
+ change_warning(0);
+ if (diff_buf_idx(curbuf) != idx_to)
+ {
+ EMSG(_("E787: Buffer changed unexpectedly"));
+ return;
+ }
+ }
+
dprev = NULL;
for (dp = curtab->tp_first_diff; dp != NULL; )
{
@@ -2131,7 +2145,8 @@ ex_diffgetput(eap)
nr = dp->df_lnum[idx_from] + start_skip + i;
if (nr > curtab->tp_diffbuf[idx_from]->b_ml.ml_line_count)
break;
- p = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx_from], nr, FALSE));
+ p = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx_from],
+ nr, FALSE));
if (p != NULL)
{
ml_append(lnum + i - 1, p, 0, FALSE);
@@ -2154,7 +2169,8 @@ ex_diffgetput(eap)
/* Check if there are any other buffers and if the diff is
* equal in them. */
for (i = 0; i < DB_COUNT; ++i)
- if (curtab->tp_diffbuf[i] != NULL && i != idx_from && i != idx_to
+ if (curtab->tp_diffbuf[i] != NULL && i != idx_from
+ && i != idx_to
&& !diff_equal_entry(dp, idx_from, i))
break;
if (i == DB_COUNT)