Mercurial > vim
diff 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 |
line wrap: on
line diff
--- a/src/buffer.c +++ b/src/buffer.c @@ -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