diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-12 23:31:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-12 23:31:17 +0800 |
commit | 7abe8ef42267db861e84ce12023b296d49de6f25 (patch) | |
tree | 3b6b6cf0e2e6df57b5d4f84ac3bcf6a73a0e22c7 | |
parent | b3f781ba912b0d24896d85fc8434faaedfddfeb2 (diff) | |
download | rneovim-7abe8ef42267db861e84ce12023b296d49de6f25.tar.gz rneovim-7abe8ef42267db861e84ce12023b296d49de6f25.tar.bz2 rneovim-7abe8ef42267db861e84ce12023b296d49de6f25.zip |
vim-patch:9.0.0862: default value of 'endoffile' is wrong (#21032)
Problem: Default value of 'endoffile' is wrong.
Solution: The default must be 'noendoffile'.
https://github.com/vim/vim/commit/0aad88f073602849d1623122eb3c323f8e252def
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | src/nvim/options.lua | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 12 |
3 files changed, 14 insertions, 2 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 4a277c146f..fd76f11046 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2164,7 +2164,7 @@ A jump table for the options with a short description can be found at |Q_op|. See 'fileencoding' to control file-content encoding. *'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/nvim/options.lua b/src/nvim/options.lua index e938760e67..dc0561d560 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -649,7 +649,7 @@ return { no_mkrc=true, redraw={'statuslines'}, varname='p_eof', - defaults={if_true=true} + defaults={if_true=false} }, { full_name='endofline', abbreviation='eol', diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index db544e47b8..11c2977a4e 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -1264,5 +1264,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 |