patch 8.0.1031: "text" argument for getqflist() is confusing
Problem: "text" argument for getqflist() is confusing. (Lcd47)
Solution: Use "lines" instead. (Yegappan Lakshmanan)
diff --git a/src/quickfix.c b/src/quickfix.c
index 1082fbd..5cbb151 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4643,15 +4643,13 @@
* Parse text from 'di' and return the quickfix list items
*/
static int
-qf_get_list_from_text(dictitem_T *di, dict_T *retdict)
+qf_get_list_from_lines(dictitem_T *di, dict_T *retdict)
{
int status = FAIL;
qf_info_T *qi;
- /* Only string and list values are supported */
- if ((di->di_tv.v_type == VAR_STRING && di->di_tv.vval.v_string != NULL)
- || (di->di_tv.v_type == VAR_LIST
- && di->di_tv.vval.v_list != NULL))
+ /* Only a List value is supported */
+ if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL)
{
list_T *l = list_alloc();
@@ -4693,8 +4691,8 @@
dictitem_T *di;
int flags = QF_GETLIST_NONE;
- if ((di = dict_find(what, (char_u *)"text", -1)) != NULL)
- return qf_get_list_from_text(di, retdict);
+ if ((di = dict_find(what, (char_u *)"lines", -1)) != NULL)
+ return qf_get_list_from_lines(di, retdict);
if (wp != NULL)
qi = GET_LOC_LIST(wp);
@@ -5053,12 +5051,10 @@
}
}
- if ((di = dict_find(what, (char_u *)"text", -1)) != NULL)
+ if ((di = dict_find(what, (char_u *)"lines", -1)) != NULL)
{
- /* Only string and list values are supported */
- if ((di->di_tv.v_type == VAR_STRING && di->di_tv.vval.v_string != NULL)
- || (di->di_tv.v_type == VAR_LIST
- && di->di_tv.vval.v_list != NULL))
+ /* Only a List value is supported */
+ if (di->di_tv.v_type == VAR_LIST && di->di_tv.vval.v_list != NULL)
{
if (action == 'r')
qf_free_items(qi, qf_idx);