patch 8.1.1922: in diff mode global operations can be very slow

Problem:    In diff mode global operations can be very slow.
Solution:   Do not call diff_redraw() many times, call it once when redrawing.
            And also don't update folds multiple times.
diff --git a/src/diff.c b/src/diff.c
index 260fdd9..4c0041d 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -75,7 +75,6 @@
 static void diff_mark_adjust_tp(tabpage_T *tp, int idx, linenr_T line1, linenr_T line2, long amount, long amount_after);
 static void diff_check_unchanged(tabpage_T *tp, diff_T *dp);
 static int diff_check_sanity(tabpage_T *tp, diff_T *dp);
-static void diff_redraw(int dofold);
 static int check_external_diff(diffio_T *diffio);
 static int diff_file(diffio_T *diffio);
 static int diff_equal_entry(diff_T *dp, int idx1, int idx2);
@@ -520,7 +519,8 @@
 
     if (tp == curtab)
     {
-	diff_redraw(TRUE);
+	// Don't redraw right away, this updates the diffs, which can be slow.
+	need_diff_redraw = TRUE;
 
 	/* Need to recompute the scroll binding, may remove or add filler
 	 * lines (e.g., when adding lines above w_topline). But it's slow when
@@ -645,13 +645,14 @@
 /*
  * Mark all diff buffers in the current tab page for redraw.
  */
-    static void
+    void
 diff_redraw(
     int		dofold)	    // also recompute the folds
 {
     win_T	*wp;
     int		n;
 
+    need_diff_redraw = FALSE;
     FOR_ALL_WINDOWS(wp)
 	if (wp->w_p_diff)
 	{
diff --git a/src/fold.c b/src/fold.c
index 482d3c9..6200578 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -813,6 +813,11 @@
 
     if (disable_fold_update > 0)
 	return;
+#ifdef FEAT_DIFF
+    if (need_diff_redraw)
+	// will update later
+	return;
+#endif
 
     /* Mark all folds from top to bot as maybe-small. */
     (void)foldFind(&wp->w_folds, top, &fp);
diff --git a/src/globals.h b/src/globals.h
index d0837d3..712a739 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1051,6 +1051,9 @@
 EXTERN int	must_redraw INIT(= 0);	    // type of redraw necessary
 EXTERN int	skip_redraw INIT(= FALSE);  // skip redraw once
 EXTERN int	do_redraw INIT(= FALSE);    // extra redraw once
+#ifdef FEAT_DIFF
+EXTERN int	need_diff_redraw INIT(= 0); // need to call diff_redraw()
+#endif
 
 EXTERN int	need_highlight_changed INIT(= TRUE);
 
diff --git a/src/proto/diff.pro b/src/proto/diff.pro
index d6ab221..2ab6c54 100644
--- a/src/proto/diff.pro
+++ b/src/proto/diff.pro
@@ -4,6 +4,7 @@
 void diff_buf_add(buf_T *buf);
 void diff_invalidate(buf_T *buf);
 void diff_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_after);
+void diff_redraw(int dofold);
 int diff_internal(void);
 void ex_diffupdate(exarg_T *eap);
 void ex_diffpatch(exarg_T *eap);
diff --git a/src/screen.c b/src/screen.c
index 5043c0d..1681e1c 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -567,6 +567,12 @@
     }
 #endif
 
+#ifdef FEAT_DIFF
+    // May have postponed updating diffs.
+    if (need_diff_redraw)
+	diff_redraw(TRUE);
+#endif
+
     if (must_redraw)
     {
 	if (type < must_redraw)	    /* use maximal type */
diff --git a/src/version.c b/src/version.c
index 58d86e5..862b3d9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1922,
+/**/
     1921,
 /**/
     1920,