0
0
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:
Bram Moolenaar
2014-03-30 16:49:09 +02:00
parent 922a4664fe
commit a392038db5
4 changed files with 37 additions and 7 deletions

View File

@@ -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;