Mercurial > vim
comparison src/fileio.c @ 1486:1f93fbcb4e0c v7.1.201
updated for version 7.1-201
author | vimboss |
---|---|
date | Fri, 04 Jan 2008 15:31:21 +0000 |
parents | e980e93d2ac2 |
children | e72e30c69d58 |
comparison
equal
deleted
inserted
replaced
1485:6d95d8976b00 | 1486:1f93fbcb4e0c |
---|---|
219 exarg_T *eap; /* can be NULL! */ | 219 exarg_T *eap; /* can be NULL! */ |
220 int flags; | 220 int flags; |
221 { | 221 { |
222 int fd = 0; | 222 int fd = 0; |
223 int newfile = (flags & READ_NEW); | 223 int newfile = (flags & READ_NEW); |
224 int set_options = newfile || (eap != NULL && eap->read_edit); | |
225 int check_readonly; | 224 int check_readonly; |
226 int filtering = (flags & READ_FILTER); | 225 int filtering = (flags & READ_FILTER); |
227 int read_stdin = (flags & READ_STDIN); | 226 int read_stdin = (flags & READ_STDIN); |
228 int read_buffer = (flags & READ_BUFFER); | 227 int read_buffer = (flags & READ_BUFFER); |
228 int set_options = newfile || read_buffer | |
229 || (eap != NULL && eap->read_edit); | |
229 linenr_T read_buf_lnum = 1; /* next line to read from curbuf */ | 230 linenr_T read_buf_lnum = 1; /* next line to read from curbuf */ |
230 colnr_T read_buf_col = 0; /* next char to read from this line */ | 231 colnr_T read_buf_col = 0; /* next char to read from this line */ |
231 char_u c; | 232 char_u c; |
232 linenr_T lnum = from; | 233 linenr_T lnum = from; |
233 char_u *ptr = NULL; /* pointer into read buffer */ | 234 char_u *ptr = NULL; /* pointer into read buffer */ |
648 if ((check_readonly && file_readonly) || curbuf->b_help) | 649 if ((check_readonly && file_readonly) || curbuf->b_help) |
649 curbuf->b_p_ro = TRUE; | 650 curbuf->b_p_ro = TRUE; |
650 | 651 |
651 if (set_options) | 652 if (set_options) |
652 { | 653 { |
653 curbuf->b_p_eol = TRUE; | 654 /* Don't change 'eol' if reading from buffer as it will already be |
654 curbuf->b_start_eol = TRUE; | 655 * correctly set when reading stdin. */ |
656 if (!read_buffer) | |
657 { | |
658 curbuf->b_p_eol = TRUE; | |
659 curbuf->b_start_eol = TRUE; | |
660 } | |
655 #ifdef FEAT_MBYTE | 661 #ifdef FEAT_MBYTE |
656 curbuf->b_p_bomb = FALSE; | 662 curbuf->b_p_bomb = FALSE; |
657 curbuf->b_start_bomb = FALSE; | 663 curbuf->b_start_bomb = FALSE; |
658 #endif | 664 #endif |
659 } | 665 } |