Mercurial > vim
comparison src/buffer.c @ 815:c68b7b2b9e07
updated for version 7.0c02
author | vimboss |
---|---|
date | Tue, 28 Mar 2006 20:57:42 +0000 |
parents | 4f1b94b51e99 |
children | 23f82b5d2814 |
comparison
equal
deleted
inserted
replaced
814:f40f1a8520ff | 815:c68b7b2b9e07 |
---|---|
379 | 379 |
380 /* Return when a window is displaying the buffer or when it's not | 380 /* Return when a window is displaying the buffer or when it's not |
381 * unloaded. */ | 381 * unloaded. */ |
382 if (buf->b_nwindows > 0 || !unload_buf) | 382 if (buf->b_nwindows > 0 || !unload_buf) |
383 { | 383 { |
384 #if 0 /* why was this here? */ | |
384 if (buf == curbuf) | 385 if (buf == curbuf) |
385 u_sync(); /* sync undo before going to another buffer */ | 386 u_sync(); /* sync undo before going to another buffer */ |
387 #endif | |
386 return; | 388 return; |
387 } | 389 } |
388 | 390 |
389 /* Always remove the buffer when there is no file name. */ | 391 /* Always remove the buffer when there is no file name. */ |
390 if (buf->b_ffname == NULL) | 392 if (buf->b_ffname == NULL) |
1310 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) | 1312 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) |
1311 if (buf_valid(prevbuf) && !aborting()) | 1313 if (buf_valid(prevbuf) && !aborting()) |
1312 #else | 1314 #else |
1313 if (buf_valid(prevbuf)) | 1315 if (buf_valid(prevbuf)) |
1314 #endif | 1316 #endif |
1317 { | |
1318 if (prevbuf == curbuf) | |
1319 u_sync(); | |
1315 close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf, | 1320 close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf, |
1316 unload ? action : (action == DOBUF_GOTO | 1321 unload ? action : (action == DOBUF_GOTO |
1317 && !P_HID(prevbuf) | 1322 && !P_HID(prevbuf) |
1318 && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0); | 1323 && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0); |
1324 } | |
1319 } | 1325 } |
1320 #ifdef FEAT_AUTOCMD | 1326 #ifdef FEAT_AUTOCMD |
1321 # ifdef FEAT_EVAL | 1327 # ifdef FEAT_EVAL |
1322 /* An autocommand may have deleted buf or aborted the script processing! */ | 1328 /* An autocommand may have deleted buf or aborted the script processing! */ |
1323 if (buf_valid(buf) && !aborting()) | 1329 if (buf_valid(buf) && !aborting()) |