Mercurial > vim
diff src/list.c @ 21118:b0baa80cb53f v8.2.1110
patch 8.2.1110: Vim9: line continuation does not work in function arguments
Commit: https://github.com/vim/vim/commit/e6b5324e3a3d354363f3c48e784c42ce3e77453f
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 1 17:28:33 2020 +0200
patch 8.2.1110: Vim9: line continuation does not work in function arguments
Problem: Vim9: line continuation does not work in function arguments.
Solution: Pass "evalarg" to get_func_tv(). Fix seeing double quoted string
as comment.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 01 Jul 2020 17:30:06 +0200 |
parents | 6dc8625889fe |
children | 4d844a65183d |
line wrap: on
line diff
--- a/src/list.c +++ b/src/list.c @@ -1177,7 +1177,7 @@ get_list_tv(char_u **arg, typval_T *rett return FAIL; } - *arg = skipwhite_and_linebreak(*arg + 1, evalarg); + *arg = skipwhite_and_linebreak_keep_string(*arg + 1, evalarg); while (**arg != ']' && **arg != NUL) { if (eval1(arg, &tv, evalarg) == FAIL) // recursive! @@ -1207,8 +1207,9 @@ get_list_tv(char_u **arg, typval_T *rett *arg = skipwhite(*arg + 1); } - // the "]" can be on the next line - *arg = skipwhite_and_linebreak(*arg, evalarg); + // The "]" can be on the next line. But a double quoted string may + // follow, not a comment. + *arg = skipwhite_and_linebreak_keep_string(*arg, evalarg); if (**arg == ']') break; @@ -2356,7 +2357,7 @@ f_insert(typval_T *argvars, typval_T *re } if (l != NULL) { - list_insert_tv(l, &argvars[1], item); + (void)list_insert_tv(l, &argvars[1], item); copy_tv(&argvars[0], rettv); } }