diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2021-07-31 12:43:23 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-31 12:43:23 +0200 |
commit | 28d8421bfb3327d7a5e81369977e8fc108b0229e (patch) | |
tree | 520f67d2496e3b19eda8593e614d3e8c38cd13e0 /src | |
parent | 890ee4e2be1dca0c07a91f836e26baead952ae7c (diff) |
patch 8.2.3254: win_gettype() does not recognize a quickfix windowv8.2.3254
Problem: win_gettype() does not recognize a quickfix window.
Solution: Add "quickfix" and "loclist". (Yegappan Lakshmanan, closes #8676)
Diffstat (limited to 'src')
-rw-r--r-- | src/evalwindow.c | 6 | ||||
-rw-r--r-- | src/misc2.c | 6 | ||||
-rw-r--r-- | src/testdir/test_quickfix.vim | 17 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 28 insertions, 3 deletions
diff --git a/src/evalwindow.c b/src/evalwindow.c index 737ca7dbd0..f043c6f4d7 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -953,6 +953,12 @@ f_win_gettype(typval_T *argvars, typval_T *rettv) else if (wp == curwin && cmdwin_type != 0) rettv->vval.v_string = vim_strsave((char_u *)"command"); #endif +#ifdef FEAT_QUICKFIX + else if (bt_quickfix(wp->w_buffer)) + rettv->vval.v_string = vim_strsave((char_u *) + (wp->w_llist_ref != NULL ? "loclist" : "quickfix")); +#endif + } /* diff --git a/src/misc2.c b/src/misc2.c index bbf55bb00c..2e83d2dd17 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1574,10 +1574,10 @@ ga_concat_len(garray_T *gap, char_u *s, size_t len) { if (s == NULL || *s == NUL) return; - if (ga_grow(gap, len) == OK) + if (ga_grow(gap, (int)len) == OK) { - mch_memmove((char *)gap->ga_data + gap->ga_len, s, (size_t)len); - gap->ga_len += len; + mch_memmove((char *)gap->ga_data + gap->ga_len, s, len); + gap->ga_len += (int)len; } } diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index e5a6d6cdbc..e22f6b28d9 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -5587,4 +5587,21 @@ func Test_locationlist_open_in_newtab() %bwipe! endfunc +" Test for win_gettype() in quickfix and location list windows +func Test_win_gettype() + copen + call assert_equal("quickfix", win_gettype()) + let wid = win_getid() + wincmd p + call assert_equal("quickfix", win_gettype(wid)) + cclose + lexpr '' + lopen + call assert_equal("loclist", win_gettype()) + let wid = win_getid() + wincmd p + call assert_equal("loclist", win_gettype(wid)) + lclose +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index b01127c34e..c901996df6 100644 --- a/src/version.c +++ b/src/version.c @@ -756,6 +756,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3254, +/**/ 3253, /**/ 3252, |