From 00466410701802214aba5c95f1cbb2e5086a37f5 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 15 Nov 2016 12:06:10 -0500 Subject: vim-patch:7.4.2204 Problem: It is not easy to get information about buffers, windows and tabpages. Solution: Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/b5ae48e9ffd3b8eb6ca4057de11f1bddcde8ce6f --- src/nvim/window.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nvim/window.c') diff --git a/src/nvim/window.c b/src/nvim/window.c index 3e7aed7867..00229ccca9 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -5797,6 +5797,19 @@ void win_id2tabwin(typval_T *argvars, list_T *list) list_append_number(list, winnr); } +win_T * win_id2wp(typval_T *argvars) +{ + int id = get_tv_number(&argvars[0]); + + FOR_ALL_TAB_WINDOWS(tp, wp) { + if (wp->handle == id) { + return wp; + } + } + + return NULL; +} + int win_id2win(typval_T *argvars) { win_T *wp; -- cgit