comparison src/testdir/test_user_func.vim @ 34567:7de5ae6a0518 v9.1.0182

patch 9.1.0182: Can define function with invalid name inside 'formatexpr' Commit: https://github.com/vim/vim/commit/6a04bf5ee523b2d6d01d7290e356a30de219f465 Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Mar 16 09:39:06 2024 +0100 patch 9.1.0182: Can define function with invalid name inside 'formatexpr' Problem: Can define function with invalid name inside 'formatexpr'. Solution: Use goto instead of checking for did_emsg later. (zeertzjq) closes: #14209 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 16 Mar 2024 09:45:04 +0100
parents 53416c49a7ab
children
comparison
equal deleted inserted replaced
34566:7a3de23515d6 34567:7de5ae6a0518
966 delfunc SecondDeferWithExcept 966 delfunc SecondDeferWithExcept
967 delfunc ThirdDefer 967 delfunc ThirdDefer
968 delfunc Foo 968 delfunc Foo
969 endfunc 969 endfunc
970 970
971 func Test_func_curly_brace_invalid_name()
972 func Fail()
973 func Foo{'()'}bar()
974 endfunc
975 endfunc
976
977 call assert_fails('call Fail()', 'E475: Invalid argument: Foo()bar')
978
979 silent! call Fail()
980 call assert_equal([], getcompletion('Foo', 'function'))
981
982 set formatexpr=Fail()
983 normal! gqq
984 call assert_equal([], getcompletion('Foo', 'function'))
985
986 set formatexpr&
987 delfunc Fail
988 endfunc
989
971 " vim: shiftwidth=2 sts=2 expandtab 990 " vim: shiftwidth=2 sts=2 expandtab