refactor: fixup! vim-patch:8.1.0877: new buffer

https://github.com/neovim/neovim/pull/9674 removed switch_to_win_for_buf().
This vim-patch removed the last relevant usage of find_win_for_buf()
Vim uses switch_to_win_for_buf() only for if_py_both.
This commit is contained in:
Jan Edmund Lazo
2025-07-17 23:28:12 -04:00
parent b79ed66e4a
commit f2d92ba6ca

View File

@@ -706,27 +706,3 @@ void restore_buffer(bufref_T *save_curbuf)
curbuf->b_nwindows++;
}
}
/// Find a window for buffer "buf".
/// If found true is returned and "wp" and "tp" are set to
/// the window and tabpage.
/// If not found, false is returned.
///
/// @param buf buffer to find a window for
/// @param[out] wp stores the found window
/// @param[out] tp stores the found tabpage
///
/// @return true if a window was found for the buffer.
bool find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp)
{
*wp = NULL;
*tp = NULL;
FOR_ALL_TAB_WINDOWS(tp2, wp2) {
if (wp2->w_buffer == buf) {
*tp = tp2;
*wp = wp2;
return true;
}
}
return false;
}