summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-09 14:56:22 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-09 14:56:22 +0200
commit820680b9ff1de8699156c7b060f97e5c0b87ad15 (patch)
tree5e28168a326ed4406a57fa9db958c3232375e104 /src/window.c
parent2514315fc2530170ad7681e45e2b6d1f0680c9eb (diff)
downloadvim-git-820680b9ff1de8699156c7b060f97e5c0b87ad15.tar.gz
patch 8.1.1832: win_execute() does not work in other tabv8.1.1832
Problem: Win_execute() does not work in other tab. (Rick Howe) Solution: Take care of the tab. (closes #4792)
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 1e1e4ba65..f4154e7e1 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6887,24 +6887,48 @@ win_id2tabwin(typval_T *argvars, list_T *list)
list_append_number(list, 0);
}
+/*
+ * Return the window pointer of window "id".
+ */
win_T *
win_id2wp(int id)
{
+ return win_id2wp_tp(id, NULL);
+}
+
+/*
+ * Return the window and tab pointer of window "id".
+ */
+ win_T *
+win_id2wp_tp(int id, tabpage_T **tpp)
+{
win_T *wp;
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_id == id)
+ {
+ if (tpp != NULL)
+ *tpp = tp;
return wp;
+ }
#ifdef FEAT_TEXT_PROP
// popup windows are in separate lists
FOR_ALL_TABPAGES(tp)
for (wp = tp->tp_first_popupwin; wp != NULL; wp = wp->w_next)
if (wp->w_id == id)
+ {
+ if (tpp != NULL)
+ *tpp = tp;
return wp;
+ }
for (wp = first_popupwin; wp != NULL; wp = wp->w_next)
if (wp->w_id == id)
+ {
+ if (tpp != NULL)
+ *tpp = tp;
return wp;
+ }
#endif
return NULL;