comparison src/userfunc.c @ 21528:e0aa9b81f6a9 v8.2.1314

patch 8.2.1314: Vim9: rule for comment after :function is confusing Commit: https://github.com/vim/vim/commit/9898107f54a330c6d9629976250a393169c698ca Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 29 14:40:25 2020 +0200 patch 8.2.1314: Vim9: rule for comment after :function is confusing Problem: Vim9: rule for comment after :function is confusing. Solution: Allow double quoted comment after :function in vim9script. (closes #6556)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Jul 2020 14:45:05 +0200
parents 574517d682cf
children cbc570e66d11
comparison
equal deleted inserted replaced
21527:79aeae3b041f 21528:e0aa9b81f6a9
2830 // When there is a line break use what follows for the function body. 2830 // When there is a line break use what follows for the function body.
2831 // Makes 'exe "func Test()\n...\nendfunc"' work. 2831 // Makes 'exe "func Test()\n...\nendfunc"' work.
2832 if (*p == '\n') 2832 if (*p == '\n')
2833 line_arg = p + 1; 2833 line_arg = p + 1;
2834 else if (*p != NUL 2834 else if (*p != NUL
2835 && !(*p == '"' && !(vim9script || eap->cmdidx == CMD_def)) 2835 && !(*p == '"' && (!vim9script || eap->cmdidx == CMD_function)
2836 && eap->cmdidx != CMD_def)
2836 && !(*p == '#' && (vim9script || eap->cmdidx == CMD_def)) 2837 && !(*p == '#' && (vim9script || eap->cmdidx == CMD_def))
2837 && !eap->skip 2838 && !eap->skip
2838 && !did_emsg) 2839 && !did_emsg)
2839 semsg(_(e_trailing_arg), p); 2840 semsg(_(e_trailing_arg), p);
2840 2841