INIT(= N_("E1301: String, Number, List or Blob required for argument %d"));
EXTERN char e_script_variable_was_deleted[]
INIT(= N_("E1302: Script variable was deleted"));
+EXTERN char e_custom_list_completion_function_does_not_return_list_but_str[]
+ INIT(= N_("E1303: Custom list completion function does not return a List but a %s"));
#endif
* Call Vim script function "func" and return the result as a List.
* Uses "argv" and "argc" as call_func_retstr().
* Returns NULL when there is something wrong.
+ * Gives an error when the returned value is not a list.
*/
void *
call_func_retlist(
if (rettv.v_type != VAR_LIST)
{
+ semsg(_(e_custom_list_completion_function_does_not_return_list_but_str),
+ vartype_name(rettv.v_type));
clear_tv(&rettv);
return NULL;
}
return "a\nb\n"
endfunc
command -nargs=* -complete=customlist,T1 TCmd1
- call feedkeys(":TCmd1 \<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_fails('call feedkeys(":TCmd1 \<C-A>\<C-B>\"\<CR>", "xt")', 'E1303: Custom list completion function does not return a List but a string')
call assert_equal('"TCmd1 ', @:)
delcommand TCmd1
delfunc T1
return {}
endfunc
command -nargs=* -complete=customlist,T2 TCmd2
- call feedkeys(":TCmd2 \<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_fails('call feedkeys(":TCmd2 \<C-A>\<C-B>\"\<CR>", "xt")', 'E1303: Custom list completion function does not return a List but a dict')
call assert_equal('"TCmd2 ', @:)
delcommand TCmd2
delfunc T2
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 437,
/**/
436,
/**/