patch 8.1.0394: diffs are not always updated correctly

Problem:    Diffs are not always updated correctly.
Solution:   When using internal diff update for any changes properly.
diff --git a/src/main.c b/src/main.c
index bf9b842..8ee1650 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1200,6 +1200,15 @@
 	    }
 
 #if defined(FEAT_DIFF)
+	    // Updating diffs from changed() does not always work properly,
+	    // esp. updating folds.  Do an update just before redrawing if
+	    // needed.
+	    if (curtab->tp_diff_update || curtab->tp_diff_invalid)
+	    {
+		ex_diffupdate(NULL);
+		curtab->tp_diff_update = FALSE;
+	    }
+
 	    /* Scroll-binding for diff mode may have been postponed until
 	     * here.  Avoids doing it for every change. */
 	    if (diff_need_scrollbind)