Patch 9.0.0862
Problem: Default value of 'endoffile' is wrong.
Solution: The default must be 'noendoffile'.
Files: runtime/doc/options.txt, src/optiondefs.h,
src/testdir/test_options.vim
*** ../vim-9.0.0861/runtime/doc/options.txt 2022-11-01 20:33:39.987400403 +0000
--- runtime/doc/options.txt 2022-11-12 11:44:39.449400880 +0000
***************
*** 3022,3028 ****
not set yet, the default for 'fileencodings' is changed.
*'endoffile'* *'eof'* *'noendoffile'* *'noeof'*
! 'endoffile' 'eof' boolean (default on)
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".
--- 3049,3055 ----
not set yet, the default for 'fileencodings' is changed.
*'endoffile'* *'eof'* *'noendoffile'* *'noeof'*
! '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".
*** ../vim-9.0.0861/src/optiondefs.h 2022-10-22 10:06:38.424322862 +0100
--- src/optiondefs.h 2022-11-12 11:44:11.701389379 +0000
***************
*** 857,863 ****
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},
{"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},
--- 857,863 ----
SCTX_INIT},
{"endoffile", "eof", P_BOOL|P_NO_MKRC|P_VI_DEF|P_RSTAT,
(char_u *)&p_eof, PV_EOF,
! {(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},
*** ../vim-9.0.0861/src/testdir/test_options.vim 2022-11-02 13:30:37.546314580 +0000
--- src/testdir/test_options.vim 2022-11-12 11:52:35.417547993 +0000
***************
*** 1453,1457 ****
--- 1453,1469 ----
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
*** ../vim-9.0.0861/src/version.c 2022-11-11 22:57:41.774304953 +0000
--- src/version.c 2022-11-12 11:53:20.741558505 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 862,
/**/
--
The future isn't what it used to be.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///