forked from aniani/vim
patch 7.4.1558
Problem: It is not easy to find out what windows display a buffer. Solution: Add win_findbuf().
This commit is contained in:
15
src/window.c
15
src/window.c
@@ -7297,4 +7297,19 @@ win_id2win(typval_T *argvars)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
win_findbuf(typval_T *argvars, list_T *list)
|
||||
{
|
||||
win_T *wp;
|
||||
tabpage_T *tp;
|
||||
int bufnr = get_tv_number(&argvars[0]);
|
||||
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
for (wp = tp == curtab ? firstwin : tp->tp_firstwin;
|
||||
wp != NULL; wp = wp->w_next)
|
||||
if (wp->w_buffer->b_fnum == bufnr)
|
||||
list_append_number(list, wp->w_id);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user