patch 7.4.1558
Problem: It is not easy to find out what windows display a buffer.
Solution: Add win_findbuf().
diff --git a/src/window.c b/src/window.c
index b6111bd..c6a6d2b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7297,4 +7297,19 @@
}
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