Mercurial > vim
diff src/userfunc.c @ 21500:574517d682cf v8.2.1300
patch 8.2.1300: Vim9: optional argument type not parsed properly
Commit: https://github.com/vim/vim/commit/4fc224ca1cf2a8991c5ea17682a742c6ad5ad0f3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 26 17:56:25 2020 +0200
patch 8.2.1300: Vim9: optional argument type not parsed properly
Problem: Vim9: optional argument type not parsed properly.
Solution: Skip over the "?". (issue https://github.com/vim/vim/issues/6507)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Jul 2020 18:00:04 +0200 |
parents | 90d859a402cc |
children | e0aa9b81f6a9 |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -123,7 +123,7 @@ one_function_arg(char_u *arg, garray_T * return arg; } type = skipwhite(p); - p = skip_type(type); + p = skip_type(type, TRUE); type = vim_strnsave(type, p - type); } else if (*skipwhite(p) != '=') @@ -2778,7 +2778,7 @@ def_function(exarg_T *eap, char_u *name_ if (*p == ':') { ret_type = skipwhite(p + 1); - p = skip_type(ret_type); + p = skip_type(ret_type, FALSE); if (p > ret_type) { ret_type = vim_strnsave(ret_type, p - ret_type);