0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.2021

Problem:    Still too many buf_valid() calls.
Solution:   Make au_new_curbuf a bufref.  Use bufref_valid() in more places.
This commit is contained in:
Bram Moolenaar
2016-07-10 19:03:57 +02:00
parent 453f37dbfd
commit 19ff9bf454
4 changed files with 24 additions and 12 deletions

View File

@@ -1293,7 +1293,7 @@ do_buffer(
* Deleting the current buffer: Need to find another buffer to go to.
* There should be another, otherwise it would have been handled
* above. However, autocommands may have deleted all buffers.
* First use au_new_curbuf, if it is valid.
* First use au_new_curbuf.br_buf, if it is valid.
* Then prefer the buffer we most recently visited.
* Else try to find one that is loaded, after the current buffer,
* then before the current buffer.
@@ -1302,8 +1302,8 @@ do_buffer(
buf = NULL; /* selected buffer */
bp = NULL; /* used when no loaded buffer found */
#ifdef FEAT_AUTOCMD
if (au_new_curbuf != NULL && buf_valid(au_new_curbuf))
buf = au_new_curbuf;
if (au_new_curbuf.br_buf != NULL && bufref_valid(&au_new_curbuf))
buf = au_new_curbuf.br_buf;
# ifdef FEAT_JUMPLIST
else
# endif