Problem: win_gettype() does not recognize a quickfix window.
Solution: Add "quickfix" and "loclist". (Yegappan Lakshmanan, closes #8676)
Return the type of the window:
"autocmd" autocommand window. Temporary window
used to execute autocommands.
- "popup" popup window |popup|
- "preview" preview window |preview-window|
"command" command-line window |cmdwin|
(empty) normal window
+ "loclist" |location-list-window|
+ "popup" popup window |popup|
+ "preview" preview window |preview-window|
+ "quickfix" |quickfix-window|
"unknown" window {nr} not found
When {nr} is omitted return the type of the current window.
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
+
}
/*
{
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;
}
}
%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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3254,
/**/
3253,
/**/