Mercurial > vim
comparison src/eval.c @ 23281:5b4db8035d1d v8.2.2186
patch 8.2.2186: Vim9: error when using 'opfunc'
Commit: https://github.com/vim/vim/commit/5b3d1bb0f5180266c4de4d815b3ea856a2fb3519
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Dec 22 12:20:08 2020 +0100
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 https://github.com/vim/vim/issues/7510)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Dec 2020 12:30:04 +0100 |
parents | a789a688e37d |
children | d5919c5fd3dc |
comparison
equal
deleted
inserted
replaced
23280:a6d48e6961aa | 23281:5b4db8035d1d |
---|---|
653 clear_tv(&rettv); | 653 clear_tv(&rettv); |
654 return retval; | 654 return retval; |
655 } | 655 } |
656 | 656 |
657 /* | 657 /* |
658 * Call Vim script function like call_func_retnr() and drop the result. | |
659 * Returns FAIL when calling the function fails. | |
660 */ | |
661 int | |
662 call_func_noret( | |
663 char_u *func, | |
664 int argc, | |
665 typval_T *argv) | |
666 { | |
667 typval_T rettv; | |
668 | |
669 if (call_vim_function(func, argc, argv, &rettv) == FAIL) | |
670 return FAIL; | |
671 clear_tv(&rettv); | |
672 return OK; | |
673 } | |
674 | |
675 /* | |
658 * Call Vim script function "func" and return the result as a string. | 676 * Call Vim script function "func" and return the result as a string. |
677 * Uses "argv" and "argc" as call_func_retnr(). | |
659 * Returns NULL when calling the function fails. | 678 * Returns NULL when calling the function fails. |
660 * Uses argv[0] to argv[argc - 1] for the function arguments. argv[argc] should | |
661 * have type VAR_UNKNOWN. | |
662 */ | 679 */ |
663 void * | 680 void * |
664 call_func_retstr( | 681 call_func_retstr( |
665 char_u *func, | 682 char_u *func, |
666 int argc, | 683 int argc, |
677 return retval; | 694 return retval; |
678 } | 695 } |
679 | 696 |
680 /* | 697 /* |
681 * Call Vim script function "func" and return the result as a List. | 698 * Call Vim script function "func" and return the result as a List. |
682 * Uses argv[0] to argv[argc - 1] for the function arguments. argv[argc] should | 699 * Uses "argv" and "argc" as call_func_retnr(). |
683 * have type VAR_UNKNOWN. | |
684 * Returns NULL when there is something wrong. | 700 * Returns NULL when there is something wrong. |
685 */ | 701 */ |
686 void * | 702 void * |
687 call_func_retlist( | 703 call_func_retlist( |
688 char_u *func, | 704 char_u *func, |