mirror of
https://github.com/neovim/neovim.git
synced 2025-09-21 10:48:18 +00:00
vim-patch:7.4.2024
Problem: More buf_valid() calls can be optimized.
Solution: Use bufref_valid() instead.
NOTE: Some changes related to channels and the Python and Netbeans interfaces
were obviously left out.
7c0a2f367f
This commit is contained in:
@@ -57,21 +57,22 @@ enum bfa_values {
|
||||
static inline void switch_to_win_for_buf(buf_T *buf,
|
||||
win_T **save_curwinp,
|
||||
tabpage_T **save_curtabp,
|
||||
buf_T **save_curbufp)
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
|
||||
if (!find_win_for_buf(buf, &wp, &tp)
|
||||
|| switch_win(save_curwinp, save_curtabp, wp, tp, true) == FAIL)
|
||||
switch_buffer(save_curbufp, buf);
|
||||
|| switch_win(save_curwinp, save_curtabp, wp, tp, true) == FAIL) {
|
||||
switch_buffer(save_curbuf, buf);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void restore_win_for_buf(win_T *save_curwin,
|
||||
tabpage_T *save_curtab,
|
||||
buf_T *save_curbuf)
|
||||
bufref_T *save_curbuf)
|
||||
{
|
||||
if (save_curbuf == NULL) {
|
||||
if (save_curbuf->br_buf == NULL) {
|
||||
restore_win(save_curwin, save_curtab, true);
|
||||
} else {
|
||||
restore_buffer(save_curbuf);
|
||||
|
Reference in New Issue
Block a user