mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
updated for version 7.4.229
Problem: Using ":let" for listing variables and the second one is a curly braces expression may fail. Solution: Check for an "=" in a better way. (ZyX)
This commit is contained in:
15
src/eval.c
15
src/eval.c
@@ -1856,8 +1856,9 @@ ex_let(eap)
|
||||
return;
|
||||
if (argend > arg && argend[-1] == '.') /* for var.='str' */
|
||||
--argend;
|
||||
expr = vim_strchr(argend, '=');
|
||||
if (expr == NULL)
|
||||
expr = skipwhite(argend);
|
||||
if (*expr != '=' && !(vim_strchr((char_u *)"+-.", *expr) != NULL
|
||||
&& expr[1] == '='))
|
||||
{
|
||||
/*
|
||||
* ":let" without "=": list variables
|
||||
@@ -1886,12 +1887,14 @@ ex_let(eap)
|
||||
{
|
||||
op[0] = '=';
|
||||
op[1] = NUL;
|
||||
if (expr > argend)
|
||||
if (*expr != '=')
|
||||
{
|
||||
if (vim_strchr((char_u *)"+-.", expr[-1]) != NULL)
|
||||
op[0] = expr[-1]; /* +=, -= or .= */
|
||||
if (vim_strchr((char_u *)"+-.", *expr) != NULL)
|
||||
op[0] = *expr; /* +=, -= or .= */
|
||||
expr = skipwhite(expr + 2);
|
||||
}
|
||||
expr = skipwhite(expr + 1);
|
||||
else
|
||||
expr = skipwhite(expr + 1);
|
||||
|
||||
if (eap->skip)
|
||||
++emsg_skip;
|
||||
|
Reference in New Issue
Block a user