mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:9.0.0819: still a build error, tests are failing
Problem: Still a build error, tests are failing.
Solution: Correct recent changes. Add missing init for 'eof'.
1577537f10
vim-patch:1577537f109d
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -689,6 +689,8 @@ void buf_clear_file(buf_T *buf)
|
|||||||
{
|
{
|
||||||
buf->b_ml.ml_line_count = 1;
|
buf->b_ml.ml_line_count = 1;
|
||||||
unchanged(buf, true, true);
|
unchanged(buf, true, true);
|
||||||
|
buf->b_p_eof = false;
|
||||||
|
buf->b_start_eof = false;
|
||||||
buf->b_p_eol = true;
|
buf->b_p_eol = true;
|
||||||
buf->b_start_eol = true;
|
buf->b_start_eol = true;
|
||||||
buf->b_p_bomb = false;
|
buf->b_p_bomb = false;
|
||||||
|
@@ -794,6 +794,7 @@ struct file_buffer {
|
|||||||
linenr_T b_no_eol_lnum; // non-zero lnum when last line of next binary
|
linenr_T b_no_eol_lnum; // non-zero lnum when last line of next binary
|
||||||
// write should not have an end-of-line
|
// write should not have an end-of-line
|
||||||
|
|
||||||
|
int b_start_eof; // last line had eof (CTRL-Z) when it was read
|
||||||
int b_start_eol; // last line had eol when it was read
|
int b_start_eol; // last line had eol when it was read
|
||||||
int b_start_ffc; // first char of 'ff' when edit started
|
int b_start_ffc; // first char of 'ff' when edit started
|
||||||
char *b_start_fenc; // 'fileencoding' when edit started or NULL
|
char *b_start_fenc; // 'fileencoding' when edit started or NULL
|
||||||
|
@@ -539,6 +539,7 @@ void unchanged(buf_T *buf, int ff, bool always_inc_changedtick)
|
|||||||
void save_file_ff(buf_T *buf)
|
void save_file_ff(buf_T *buf)
|
||||||
{
|
{
|
||||||
buf->b_start_ffc = (unsigned char)(*buf->b_p_ff);
|
buf->b_start_ffc = (unsigned char)(*buf->b_p_ff);
|
||||||
|
buf->b_start_eof = buf->b_p_eof;
|
||||||
buf->b_start_eol = buf->b_p_eol;
|
buf->b_start_eol = buf->b_p_eol;
|
||||||
buf->b_start_bomb = buf->b_p_bomb;
|
buf->b_start_bomb = buf->b_p_bomb;
|
||||||
|
|
||||||
@@ -573,7 +574,8 @@ bool file_ff_differs(buf_T *buf, bool ignore_empty)
|
|||||||
if (buf->b_start_ffc != *buf->b_p_ff) {
|
if (buf->b_start_ffc != *buf->b_p_ff) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((buf->b_p_bin || !buf->b_p_fixeol) && buf->b_start_eol != buf->b_p_eol) {
|
if ((buf->b_p_bin || !buf->b_p_fixeol)
|
||||||
|
&& (buf->b_start_eof != buf->b_p_eof || buf->b_start_eol != buf->b_p_eol)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb) {
|
if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb) {
|
||||||
|
@@ -524,8 +524,9 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
|
|||||||
// Don't change 'eol' if reading from buffer as it will already be
|
// Don't change 'eol' if reading from buffer as it will already be
|
||||||
// correctly set when reading stdin.
|
// correctly set when reading stdin.
|
||||||
if (!read_buffer) {
|
if (!read_buffer) {
|
||||||
curbuf->b_p_eol = true;
|
|
||||||
curbuf->b_p_eof = false;
|
curbuf->b_p_eof = false;
|
||||||
|
curbuf->b_start_eof = false;
|
||||||
|
curbuf->b_p_eol = true;
|
||||||
curbuf->b_start_eol = true;
|
curbuf->b_start_eol = true;
|
||||||
}
|
}
|
||||||
curbuf->b_p_bomb = false;
|
curbuf->b_p_bomb = false;
|
||||||
@@ -1629,13 +1630,16 @@ failed:
|
|||||||
if (!error
|
if (!error
|
||||||
&& !got_int
|
&& !got_int
|
||||||
&& linerest != 0
|
&& linerest != 0
|
||||||
|
// TODO(vim): should we handle CTRL-Z differently here for 'endoffile'?
|
||||||
&& !(!curbuf->b_p_bin
|
&& !(!curbuf->b_p_bin
|
||||||
&& fileformat == EOL_DOS)) {
|
&& fileformat == EOL_DOS
|
||||||
|
&& *line_start == Ctrl_Z
|
||||||
|
&& ptr == line_start + 1)) {
|
||||||
// remember for when writing
|
// remember for when writing
|
||||||
if (set_options) {
|
if (set_options) {
|
||||||
curbuf->b_p_eol = false;
|
curbuf->b_p_eol = false;
|
||||||
if (*line_start == Ctrl_Z && ptr == line_start + 1) {
|
if (*line_start == Ctrl_Z && ptr == line_start + 1) {
|
||||||
curbuf->b_p_eof = false;
|
curbuf->b_p_eof = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*ptr = NUL;
|
*ptr = NUL;
|
||||||
|
@@ -34,10 +34,10 @@ func Test_fixeol()
|
|||||||
w >>XXTestEol
|
w >>XXTestEol
|
||||||
w >>XXTestNoEol
|
w >>XXTestNoEol
|
||||||
|
|
||||||
call assert_equal(['with eol', 'END'], readfile('XXEol'))
|
call assert_equal(['with eol or eof', 'END'], readfile('XXEol'))
|
||||||
call assert_equal(['without eolEND'], readfile('XXNoEol'))
|
call assert_equal(['without eol or eofEND'], readfile('XXNoEol'))
|
||||||
call assert_equal(['with eol', 'stays eol', 'END'], readfile('XXTestEol'))
|
call assert_equal(['with eol or eof', 'stays eol', 'END'], readfile('XXTestEol'))
|
||||||
call assert_equal(['without eol', 'stays withoutEND'],
|
call assert_equal(['without eol or eof', 'stays withoutEND'],
|
||||||
\ readfile('XXTestNoEol'))
|
\ readfile('XXTestNoEol'))
|
||||||
|
|
||||||
call delete('XXEol')
|
call delete('XXEol')
|
||||||
|
Reference in New Issue
Block a user