Mercurial > vim
changeset 1486:1f93fbcb4e0c v7.1.201
updated for version 7.1-201
author | vimboss |
---|---|
date | Fri, 04 Jan 2008 15:31:21 +0000 |
parents | 6d95d8976b00 |
children | 28558ab31051 |
files | src/fileio.c src/version.c |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c +++ b/src/fileio.c @@ -221,11 +221,12 @@ readfile(fname, sfname, from, lines_to_s { int fd = 0; int newfile = (flags & READ_NEW); - int set_options = newfile || (eap != NULL && eap->read_edit); int check_readonly; int filtering = (flags & READ_FILTER); int read_stdin = (flags & READ_STDIN); int read_buffer = (flags & READ_BUFFER); + int set_options = newfile || read_buffer + || (eap != NULL && eap->read_edit); linenr_T read_buf_lnum = 1; /* next line to read from curbuf */ colnr_T read_buf_col = 0; /* next char to read from this line */ char_u c; @@ -650,8 +651,13 @@ readfile(fname, sfname, from, lines_to_s if (set_options) { - curbuf->b_p_eol = TRUE; - curbuf->b_start_eol = TRUE; + /* Don't change 'eol' if reading from buffer as it will already be + * correctly set when reading stdin. */ + if (!read_buffer) + { + curbuf->b_p_eol = TRUE; + curbuf->b_start_eol = TRUE; + } #ifdef FEAT_MBYTE curbuf->b_p_bomb = FALSE; curbuf->b_start_bomb = FALSE;