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:
@@ -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
|
||||
|
Reference in New Issue
Block a user