diff options
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | src/misc1.c | 2 | ||||
-rw-r--r-- | src/option.c | 9 | ||||
-rw-r--r-- | src/proto/option.pro | 2 | ||||
-rw-r--r-- | src/undo.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
6 files changed, 20 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore index a0d4f33f1..676cd4ec6 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,11 @@ gvimext.lib *.mo *.swp *~ + +# Generated by "make test" +src/po/*.ck +src/testdir/mbyte.vim +src/testdir/mzscheme.vim +src/testdir/small.vim +src/testdir/tiny.vim +src/testdir/test*.out diff --git a/src/misc1.c b/src/misc1.c index 7235617fc..9f3eff157 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -2919,7 +2919,7 @@ unchanged(buf, ff) buf_T *buf; int ff; /* also reset 'fileformat' */ { - if (buf->b_changed || (ff && file_ff_differs(buf))) + if (buf->b_changed || (ff && file_ff_differs(buf, FALSE))) { buf->b_changed = 0; ml_setflags(buf); 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; diff --git a/src/proto/option.pro b/src/proto/option.pro index d14c89b28..15cf2b4f8 100644 --- a/src/proto/option.pro +++ b/src/proto/option.pro @@ -54,6 +54,6 @@ void change_compatible __ARGS((int on)); int option_was_set __ARGS((char_u *name)); int can_bs __ARGS((int what)); void save_file_ff __ARGS((buf_T *buf)); -int file_ff_differs __ARGS((buf_T *buf)); +int file_ff_differs __ARGS((buf_T *buf, int ignore_empty)); int check_ff_value __ARGS((char_u *p)); /* vim: set ft=c : */ diff --git a/src/undo.c b/src/undo.c index ec7b1a4ae..af91bd3cd 100644 --- a/src/undo.c +++ b/src/undo.c @@ -3304,7 +3304,7 @@ bufIsChanged(buf) #ifdef FEAT_QUICKFIX !bt_dontwrite(buf) && #endif - (buf->b_changed || file_ff_differs(buf)); + (buf->b_changed || file_ff_differs(buf, TRUE)); } int @@ -3314,7 +3314,7 @@ curbufIsChanged() #ifdef FEAT_QUICKFIX !bt_dontwrite(curbuf) && #endif - (curbuf->b_changed || file_ff_differs(curbuf)); + (curbuf->b_changed || file_ff_differs(curbuf, TRUE)); } #if defined(FEAT_EVAL) || defined(PROTO) diff --git a/src/version.c b/src/version.c index 3f6a8a140..107cdea69 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 103, +/**/ 102, /**/ 101, |