comparison src/buffer.c @ 625:81fe2ccc1207 v7.0179

updated for version 7.0179
author vimboss
date Thu, 12 Jan 2006 23:22:24 +0000
parents 111509d2767a
children 68a196b7504d
comparison
equal deleted inserted replaced
624:91e7d4a7b3b0 625:81fe2ccc1207
80 */ 80 */
81 if (readonlymode && curbuf->b_ffname != NULL 81 if (readonlymode && curbuf->b_ffname != NULL
82 && (curbuf->b_flags & BF_NEVERLOADED)) 82 && (curbuf->b_flags & BF_NEVERLOADED))
83 curbuf->b_p_ro = TRUE; 83 curbuf->b_p_ro = TRUE;
84 84
85 if (ml_open() == FAIL) 85 if (ml_open(curbuf) == FAIL)
86 { 86 {
87 /* 87 /*
88 * There MUST be a memfile, otherwise we can't do anything 88 * There MUST be a memfile, otherwise we can't do anything
89 * If we can't create one for the current buffer, take another buffer 89 * If we can't create one for the current buffer, take another buffer
90 */ 90 */
1503 /* 1503 /*
1504 * If the current buffer has no name and no contents, use the current 1504 * If the current buffer has no name and no contents, use the current
1505 * buffer. Otherwise: Need to allocate a new buffer structure. 1505 * buffer. Otherwise: Need to allocate a new buffer structure.
1506 * 1506 *
1507 * This is the ONLY place where a new buffer structure is allocated! 1507 * This is the ONLY place where a new buffer structure is allocated!
1508 * (A spell file buffer is allocated in spell.c, but that's not a normal
1509 * buffer.)
1508 */ 1510 */
1509 buf = NULL; 1511 buf = NULL;
1510 if ((flags & BLN_CURBUF) 1512 if ((flags & BLN_CURBUF)
1511 && curbuf != NULL 1513 && curbuf != NULL
1512 && curbuf->b_ffname == NULL 1514 && curbuf->b_ffname == NULL
5189 #else 5191 #else
5190 curbuf = newbuf; 5192 curbuf = newbuf;
5191 curwin->w_buffer = newbuf; 5193 curwin->w_buffer = newbuf;
5192 #endif 5194 #endif
5193 5195
5194 if (ml_open() == OK 5196 if (ml_open(curbuf) == OK
5195 && readfile(buf->b_ffname, buf->b_fname, 5197 && readfile(buf->b_ffname, buf->b_fname,
5196 (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, 5198 (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM,
5197 &ea, READ_NEW | READ_DUMMY) == OK) 5199 &ea, READ_NEW | READ_DUMMY) == OK)
5198 { 5200 {
5199 /* compare the two files line by line */ 5201 /* compare the two files line by line */