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
|
END
|
||||||
endif
|
endif
|
||||||
call assert_equal([], check)
|
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
|
endfunc
|
||||||
|
@ -2482,9 +2482,14 @@ ex_function(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for ":let v =<< [trim] EOF"
|
// Check for ":let v =<< [trim] EOF"
|
||||||
|
// and ":let [a, b] =<< [trim] EOF"
|
||||||
arg = skipwhite(skiptowhite(p));
|
arg = skipwhite(skiptowhite(p));
|
||||||
|
if (*arg == '[')
|
||||||
|
arg = vim_strchr(arg, ']');
|
||||||
|
if (arg != NULL)
|
||||||
|
{
|
||||||
arg = skipwhite(skiptowhite(arg));
|
arg = skipwhite(skiptowhite(arg));
|
||||||
if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
|
if ( arg[0] == '=' && arg[1] == '<' && arg[2] =='<'
|
||||||
&& ((p[0] == 'l'
|
&& ((p[0] == 'l'
|
||||||
&& p[1] == 'e'
|
&& p[1] == 'e'
|
||||||
&& (!ASCII_ISALNUM(p[2])
|
&& (!ASCII_ISALNUM(p[2])
|
||||||
@ -2503,6 +2508,7 @@ ex_function(exarg_T *eap)
|
|||||||
is_heredoc = TRUE;
|
is_heredoc = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Add the line to the function. */
|
/* Add the line to the function. */
|
||||||
if (ga_grow(&newlines, 1 + sourcing_lnum_off) == FAIL)
|
if (ga_grow(&newlines, 1 + sourcing_lnum_off) == FAIL)
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2262,
|
||||||
/**/
|
/**/
|
||||||
2261,
|
2261,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user