comparison src/window.c @ 8536:09041d2fd7d0 v7.4.1558

commit https://github.com/vim/vim/commit/9cdf86b86f5fdb5a45b682f336846f9d9a9c6f1f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 13 19:04:51 2016 +0100 patch 7.4.1558 Problem: It is not easy to find out what windows display a buffer. Solution: Add win_findbuf().
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Mar 2016 19:15:05 +0100
parents 485d4d8a97f6
children 24b43dd167eb
comparison
equal deleted inserted replaced
8535:6ec2cb295acd 8536:09041d2fd7d0
7295 return nr; 7295 return nr;
7296 ++nr; 7296 ++nr;
7297 } 7297 }
7298 return 0; 7298 return 0;
7299 } 7299 }
7300 #endif 7300
7301 void
7302 win_findbuf(typval_T *argvars, list_T *list)
7303 {
7304 win_T *wp;
7305 tabpage_T *tp;
7306 int bufnr = get_tv_number(&argvars[0]);
7307
7308 for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
7309 for (wp = tp == curtab ? firstwin : tp->tp_firstwin;
7310 wp != NULL; wp = wp->w_next)
7311 if (wp->w_buffer->b_fnum == bufnr)
7312 list_append_number(list, wp->w_id);
7313 }
7314
7315 #endif