Mercurial > vim
comparison src/buffer.c @ 9481:7520696c14b0 v7.4.2021
commit https://github.com/vim/vim/commit/19ff9bf454b7492be64dd87aaf0830fa7961871e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 10 19:03:57 2016 +0200
patch 7.4.2021
Problem: Still too many buf_valid() calls.
Solution: Make au_new_curbuf a bufref. Use bufref_valid() in more places.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Jul 2016 19:15:06 +0200 |
parents | 6149d1374ea0 |
children | c16e207dc465 |
comparison
equal
deleted
inserted
replaced
9480:8d1406fbb955 | 9481:7520696c14b0 |
---|---|
1291 | 1291 |
1292 /* | 1292 /* |
1293 * Deleting the current buffer: Need to find another buffer to go to. | 1293 * Deleting the current buffer: Need to find another buffer to go to. |
1294 * There should be another, otherwise it would have been handled | 1294 * There should be another, otherwise it would have been handled |
1295 * above. However, autocommands may have deleted all buffers. | 1295 * above. However, autocommands may have deleted all buffers. |
1296 * First use au_new_curbuf, if it is valid. | 1296 * First use au_new_curbuf.br_buf, if it is valid. |
1297 * Then prefer the buffer we most recently visited. | 1297 * Then prefer the buffer we most recently visited. |
1298 * Else try to find one that is loaded, after the current buffer, | 1298 * Else try to find one that is loaded, after the current buffer, |
1299 * then before the current buffer. | 1299 * then before the current buffer. |
1300 * Finally use any buffer. | 1300 * Finally use any buffer. |
1301 */ | 1301 */ |
1302 buf = NULL; /* selected buffer */ | 1302 buf = NULL; /* selected buffer */ |
1303 bp = NULL; /* used when no loaded buffer found */ | 1303 bp = NULL; /* used when no loaded buffer found */ |
1304 #ifdef FEAT_AUTOCMD | 1304 #ifdef FEAT_AUTOCMD |
1305 if (au_new_curbuf != NULL && buf_valid(au_new_curbuf)) | 1305 if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf)) |
1306 buf = au_new_curbuf; | 1306 buf = au_new_curbuf.br_buf; |
1307 # ifdef FEAT_JUMPLIST | 1307 # ifdef FEAT_JUMPLIST |
1308 else | 1308 else |
1309 # endif | 1309 # endif |
1310 #endif | 1310 #endif |
1311 #ifdef FEAT_JUMPLIST | 1311 #ifdef FEAT_JUMPLIST |