#if defined(FEAT_DIFF) || defined(PROTO)
-static int diff_busy = FALSE; /* ex_diffgetput() is busy */
+static int diff_busy = FALSE; // using diff structs, don't change them
+static int diff_need_update = FALSE; // ex_diffupdate needs to be called
/* flags obtained from the 'diffopt' option */
#define DIFF_FILLER 0x001 // display filler lines
int idx_new;
diffio_T diffio;
+ if (diff_busy)
+ {
+ diff_need_update = TRUE;
+ return;
+ }
+
// Delete all diffblocks.
diff_clear(curtab);
curtab->tp_diff_invalid = FALSE;
if (diff_buf_idx(curbuf) != idx_to)
{
EMSG(_("E787: Buffer changed unexpectedly"));
- return;
+ goto theend;
}
}
aucmd_restbuf(&aco);
}
+theend:
diff_busy = FALSE;
+ if (diff_need_update)
+ {
+ diff_need_update = FALSE;
+ ex_diffupdate(NULL);
+ }
/* Check that the cursor is on a valid character and update it's position.
* When there were filler lines the topline has become invalid. */