diff options
author | Bram Moolenaar <Bram@vim.org> | 2011-01-22 00:11:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2011-01-22 00:11:50 +0100 |
commit | 164c60f5b1042419698ca7758bb2e32ed77bdede (patch) | |
tree | b1382d2092c335fdeb89f4ae885501b7e8414868 /src/option.c | |
parent | d2c340a6a696ecb498a3d293f377313fab66393b (diff) | |
download | vim-git-164c60f5b1042419698ca7758bb2e32ed77bdede.tar.gz |
updated for version 7.3.103v7.3.103
Problem: Changing 'fileformat' and then using ":w" in an empty file sets
the 'modified' option.
Solution: In unchanged() don't ignore 'ff' for an empty file.
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c index 87eadd04f..f1fcd69d0 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; |