mirror of
https://github.com/vim/vim.git
synced 2025-10-04 05:25:06 -04:00
patch 8.2.2186: Vim9: error when using 'opfunc'
Problem: Vim9: error when using 'opfunc'. Solution: Do not expect a return value from 'opfunc'. (closes #7510)
This commit is contained in:
24
src/eval.c
24
src/eval.c
@@ -654,11 +654,28 @@ call_func_retnr(
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call Vim script function like call_func_retnr() and drop the result.
|
||||
* Returns FAIL when calling the function fails.
|
||||
*/
|
||||
int
|
||||
call_func_noret(
|
||||
char_u *func,
|
||||
int argc,
|
||||
typval_T *argv)
|
||||
{
|
||||
typval_T rettv;
|
||||
|
||||
if (call_vim_function(func, argc, argv, &rettv) == FAIL)
|
||||
return FAIL;
|
||||
clear_tv(&rettv);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Call Vim script function "func" and return the result as a string.
|
||||
* Uses "argv" and "argc" as call_func_retnr().
|
||||
* Returns NULL when calling the function fails.
|
||||
* Uses argv[0] to argv[argc - 1] for the function arguments. argv[argc] should
|
||||
* have type VAR_UNKNOWN.
|
||||
*/
|
||||
void *
|
||||
call_func_retstr(
|
||||
@@ -679,8 +696,7 @@ call_func_retstr(
|
||||
|
||||
/*
|
||||
* Call Vim script function "func" and return the result as a List.
|
||||
* Uses argv[0] to argv[argc - 1] for the function arguments. argv[argc] should
|
||||
* have type VAR_UNKNOWN.
|
||||
* Uses "argv" and "argc" as call_func_retnr().
|
||||
* Returns NULL when there is something wrong.
|
||||
*/
|
||||
void *
|
||||
|
Reference in New Issue
Block a user