]> granicus.if.org Git - vim/commitdiff
patch 8.1.0494: functions do not check for a window ID in other tabs v8.1.0494
authorBram Moolenaar <Bram@vim.org>
Thu, 25 Oct 2018 11:11:16 +0000 (13:11 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 25 Oct 2018 11:11:16 +0000 (13:11 +0200)
Problem:    Functions do not check for a window ID in other tabs.
Solution:   Also find the window ID in other than the current tab.

src/evalfunc.c
src/version.c

index b69752416f33863f4ddaa62edcf8795b4552985f..82ea05af3354e63411cccaffd4c865ba571f00f4 100644 (file)
@@ -5291,7 +5291,7 @@ f_getloclist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
 #ifdef FEAT_QUICKFIX
     win_T      *wp;
 
-    wp = find_win_by_nr(&argvars[0], NULL);
+    wp = find_win_by_nr_or_id(&argvars[0]);
     get_qf_loc_list(FALSE, wp, &argvars[1], rettv);
 #endif
 }
@@ -5796,7 +5796,7 @@ f_win_screenpos(typval_T *argvars, typval_T *rettv)
     if (rettv_list_alloc(rettv) == FAIL)
        return;
 
-    wp = find_win_by_nr(&argvars[0], NULL);
+    wp = find_win_by_nr_or_id(&argvars[0]);
     list_append_number(rettv->vval.v_list, wp == NULL ? 0 : wp->w_winrow + 1);
     list_append_number(rettv->vval.v_list, wp == NULL ? 0 : wp->w_wincol + 1);
 }
@@ -8028,7 +8028,7 @@ matchadd_dict_arg(typval_T *tv, char_u **conceal_char, win_T **win)
 
     if ((di = dict_find(tv->vval.v_dict, (char_u *)"window", -1)) != NULL)
     {
-       *win = find_win_by_nr(&di->di_tv, NULL);
+       *win = find_win_by_nr_or_id(&di->di_tv);
        if (*win == NULL)
        {
            EMSG(_("E957: Invalid window number"));
@@ -10785,7 +10785,7 @@ f_setloclist(typval_T *argvars, typval_T *rettv)
 
     rettv->vval.v_number = -1;
 
-    win = find_win_by_nr(&argvars[0], NULL);
+    win = find_win_by_nr_or_id(&argvars[0]);
     if (win != NULL)
        set_qf_ll_list(win, &argvars[1], &argvars[2], &argvars[3], rettv);
 }
@@ -13843,7 +13843,7 @@ f_winbufnr(typval_T *argvars, typval_T *rettv)
 {
     win_T      *wp;
 
-    wp = find_win_by_nr(&argvars[0], NULL);
+    wp = find_win_by_nr_or_id(&argvars[0]);
     if (wp == NULL)
        rettv->vval.v_number = -1;
     else
@@ -13868,7 +13868,7 @@ f_winheight(typval_T *argvars, typval_T *rettv)
 {
     win_T      *wp;
 
-    wp = find_win_by_nr(&argvars[0], NULL);
+    wp = find_win_by_nr_or_id(&argvars[0]);
     if (wp == NULL)
        rettv->vval.v_number = -1;
     else
@@ -14035,7 +14035,7 @@ f_winwidth(typval_T *argvars, typval_T *rettv)
 {
     win_T      *wp;
 
-    wp = find_win_by_nr(&argvars[0], NULL);
+    wp = find_win_by_nr_or_id(&argvars[0]);
     if (wp == NULL)
        rettv->vval.v_number = -1;
     else
index 7900ee74184920386dcc1b1bfd3e9f6e028d444b..7297ad59a9aea8f9147466302ad7a4f8567ae190 100644 (file)
@@ -792,6 +792,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    494,
 /**/
     493,
 /**/