From: Bram Moolenaar Date: Thu, 25 Oct 2018 11:11:16 +0000 (+0200) Subject: patch 8.1.0494: functions do not check for a window ID in other tabs X-Git-Tag: v8.1.0494 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=babfcf54ae9bf9570eddf4958a553635cd589e21;p=vim patch 8.1.0494: functions do not check for a window ID in other tabs Problem: Functions do not check for a window ID in other tabs. Solution: Also find the window ID in other than the current tab. --- diff --git a/src/evalfunc.c b/src/evalfunc.c index b69752416..82ea05af3 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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 diff --git a/src/version.c b/src/version.c index 7900ee741..7297ad59a 100644 --- a/src/version.c +++ b/src/version.c @@ -792,6 +792,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 494, /**/ 493, /**/