# HG changeset patch # User Bram Moolenaar # Date 1668254405 -3600 # Node ID 5a95f0c630b16e2a36ebed40fbe3d8b785ca73a9 # Parent a0f0c144baff752d8c284d343cc1aae237b6968f patch 9.0.0862: default value of 'endoffile' is wrong Commit: https://github.com/vim/vim/commit/0aad88f073602849d1623122eb3c323f8e252def Author: Bram Moolenaar Date: Sat Nov 12 11:54:26 2022 +0000 patch 9.0.0862: default value of 'endoffile' is wrong Problem: Default value of 'endoffile' is wrong. Solution: The default must be 'noendoffile'. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -3049,7 +3049,7 @@ A jump table for the options with a shor not set yet, the default for 'fileencodings' is changed. *'endoffile'* *'eof'* *'noendoffile'* *'noeof'* -'endoffile' 'eof' boolean (default on) +'endoffile' 'eof' boolean (default off) local to buffer Indicates that a CTRL-Z character was found at the end of the file when reading it. Normally only happens when 'fileformat' is "dos". diff --git a/src/optiondefs.h b/src/optiondefs.h --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -857,7 +857,7 @@ static struct vimoption options[] = SCTX_INIT}, {"endoffile", "eof", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT, (char_u *)&p_eof, PV_EOF, - {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, + {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"endofline", "eol", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT, (char_u *)&p_eol, PV_EOL, {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -1453,5 +1453,17 @@ func Test_keywordprg_empty() let &keywordprg = k endfunc +" check that the very first buffer created does not have 'endoffile' set +func Test_endoffile_default() + let after =<< trim [CODE] + call writefile([execute('set eof?')], 'Xtestout') + qall! + [CODE] + if RunVim([], after, '') + call assert_equal(["\nnoendoffile"], readfile('Xtestout')) + endif + call delete('Xtestout') +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 862, +/**/ 861, /**/ 860,