patch 8.2.0064: diffmode completion doesn't use per-window setting

Problem:    Diffmode completion doesn't use per-window setting.
Solution:   Check if a window is in diff mode. (Dominique Pell, closes #5419)
diff --git a/src/buffer.c b/src/buffer.c
index dd3593f..eb6b287 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2661,6 +2661,11 @@
     *num_file = 0;		    // return values in case of FAIL
     *file = NULL;
 
+#ifdef FEAT_DIFF
+    if ((options & BUF_DIFF_FILTER) && !curwin->w_p_diff)
+	return FAIL;
+#endif
+
     // Make a copy of "pat" and change "^" to "\(^\|[\/]\)".
     if (*pat == '^')
     {
@@ -2706,8 +2711,7 @@
 		if (options & BUF_DIFF_FILTER)
 		    // Skip buffers not suitable for
 		    // :diffget or :diffput completion.
-		    if (buf == curbuf
-			    || !diff_mode_buf(curbuf) || !diff_mode_buf(buf))
+		    if (buf == curbuf || !diff_mode_buf(buf))
 			continue;
 #endif