mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.2262: unpack assignment in function not recognized
Problem: Unpack assignment in function not recognized. Solution: Skip over "[a, b]". (closes #5051)
This commit is contained in:
parent
177c9f2f06
commit
1e673b9eb6
@ -303,4 +303,12 @@ E
|
||||
END
|
||||
endif
|
||||
call assert_equal([], check)
|
||||
|
||||
" unpack assignment
|
||||
let [a, b, c] =<< END
|
||||
x
|
||||
\y
|
||||
z
|
||||
END
|
||||
call assert_equal([' x', ' \y', ' z'], [a, b, c])
|
||||
endfunc
|
||||
|
@ -2482,7 +2482,12 @@ ex_function(exarg_T *eap)
|
||||
}
|
||||
|
||||
// Check for ":let v =<< [trim] EOF"
|
||||
// and ":let [a, b] =<< [trim] EOF"
|
||||
arg = skipwhite(skiptowhite(p));
|
||||
if (*arg == '[')
|
||||
arg = vim_strchr(arg, ']');
|
||||
if (arg != NULL)
|
||||
{
|
||||
arg = skipwhite(skiptowhite(arg));
|
||||
if ( arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
|
||||
&& ((p[0] == 'l'
|
||||
@ -2503,6 +2508,7 @@ ex_function(exarg_T *eap)
|
||||
is_heredoc = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add the line to the function. */
|
||||
if (ga_grow(&newlines, 1 + sourcing_lnum_off) == FAIL)
|
||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2262,
|
||||
/**/
|
||||
2261,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user