mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
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:
@@ -706,27 +706,3 @@ void restore_buffer(bufref_T *save_curbuf)
|
|||||||
curbuf->b_nwindows++;
|
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;
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user