patch 8.1.2289: after :diffsplit closing the window does not disable diff

Problem:    After :diffsplit closing the window does not disable diff.
Solution:   Add "closeoff" to 'diffopt' and add it to the default.
diff --git a/src/window.c b/src/window.c
index abdbd50..a1cda83 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2438,6 +2438,9 @@
     int		help_window = FALSE;
     tabpage_T   *prev_curtab = curtab;
     frame_T	*win_frame = win->w_frame->fr_parent;
+#ifdef FEAT_DIFF
+    int		had_diffmode = win->w_p_diff;
+#endif
 
     if (ERROR_IF_POPUP_WINDOW)
 	return FAIL;
@@ -2625,6 +2628,23 @@
     if (help_window)
 	restore_snapshot(SNAP_HELP_IDX, close_curwin);
 
+#ifdef FEAT_DIFF
+    // If the window had 'diff' set and now there is only one window left in
+    // the tab page with 'diff' set, and "closeoff" is in 'diffopt', then
+    // execute ":diffoff!".
+    if (diffopt_closeoff() && had_diffmode && curtab == prev_curtab)
+    {
+	int	diffcount = 0;
+	win_T	*dwin;
+
+	FOR_ALL_WINDOWS(dwin)
+	    if (dwin->w_p_diff)
+		++diffcount;
+	if (diffcount == 1)
+	    do_cmdline_cmd((char_u *)"diffoff!");
+    }
+#endif
+
 #if defined(FEAT_GUI)
     /* When 'guioptions' includes 'L' or 'R' may have to remove scrollbars. */
     if (gui.in_use && !win_hasvertsplit())