summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index 87eadd04fd..f1fcd69d0f 100644
--- a/src/option.c
+++ b/src/option.c
@@ -11296,16 +11296,19 @@ save_file_ff(buf)
* from when editing started (save_file_ff() called).
* Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
* changed and 'binary' is not set.
- * Don't consider a new, empty buffer to be changed.
+ * When "ignore_empty" is true don't consider a new, empty buffer to be
+ * changed.
*/
int
-file_ff_differs(buf)
+file_ff_differs(buf, ignore_empty)
buf_T *buf;
+ int ignore_empty;
{
/* In a buffer that was never loaded the options are not valid. */
if (buf->b_flags & BF_NEVERLOADED)
return FALSE;
- if ((buf->b_flags & BF_NEW)
+ if (ignore_empty
+ && (buf->b_flags & BF_NEW)
&& buf->b_ml.ml_line_count == 1
&& *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)
return FALSE;