diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-06 22:32:54 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-09 09:58:32 -0500 |
commit | 3e2f7baf2138c204a9d94e2dc2cae7900b0b6122 (patch) | |
tree | 7888c7c433ab388db430c8dced80c086389401c8 /src/nvim/eval.c | |
parent | c3cb54b5ff20c1a126cbbe9b964ceebff0c60ded (diff) | |
download | rneovim-3e2f7baf2138c204a9d94e2dc2cae7900b0b6122.tar.gz rneovim-3e2f7baf2138c204a9d94e2dc2cae7900b0b6122.tar.bz2 rneovim-3e2f7baf2138c204a9d94e2dc2cae7900b0b6122.zip |
vim-patch:8.1.2262: unpack assignment in function not recognized
Problem: Unpack assignment in function not recognized.
Solution: Skip over "[a, b]". (closes vim/vim#5051)
https://github.com/vim/vim/commit/1e673b9eb686459bd0e7fc3f2199dd077546a18e
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index fd83bc846b..e08e129656 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -21742,22 +21742,31 @@ void ex_function(exarg_T *eap) } // Check for ":let v =<< [trim] EOF" + // and ":let [a, b] =<< [trim] EOF" arg = skipwhite(skiptowhite(p)); - arg = skipwhite(skiptowhite(arg)); - if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<' - && ((p[0] == 'l' && p[1] == 'e' - && (!ASCII_ISALNUM(p[2]) - || (p[2] == 't' && !ASCII_ISALNUM(p[3])))))) { - p = skipwhite(arg + 3); - if (STRNCMP(p, "trim", 4) == 0) { - // Ignore leading white space. - p = skipwhite(p + 4); - heredoc_trimmed = vim_strnsave(theline, - (int)(skipwhite(theline) - theline)); + if (*arg == '[') { + arg = vim_strchr(arg, ']'); + } + if (arg != NULL) { + arg = skipwhite(skiptowhite(arg)); + if (arg[0] == '=' + && arg[1] == '<' + && arg[2] =='<' + && (p[0] == 'l' + && p[1] == 'e' + && (!ASCII_ISALNUM(p[2]) + || (p[2] == 't' && !ASCII_ISALNUM(p[3]))))) { + p = skipwhite(arg + 3); + if (STRNCMP(p, "trim", 4) == 0) { + // Ignore leading white space. + p = skipwhite(p + 4); + heredoc_trimmed = + vim_strnsave(theline, (int)(skipwhite(theline) - theline)); + } + skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p)); + do_concat = false; + is_heredoc = true; } - skip_until = vim_strnsave(p, (int)(skiptowhite(p) - p)); - do_concat = false; - is_heredoc = true; } } |