|
|
073263 |
To: vim_dev@googlegroups.com
|
|
|
073263 |
Subject: Patch 7.4.229
|
|
|
073263 |
Fcc: outbox
|
|
|
073263 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
|
073263 |
Mime-Version: 1.0
|
|
|
073263 |
Content-Type: text/plain; charset=UTF-8
|
|
|
073263 |
Content-Transfer-Encoding: 8bit
|
|
|
073263 |
------------
|
|
|
073263 |
|
|
|
073263 |
Patch 7.4.229
|
|
|
073263 |
Problem: Using ":let" for listing variables and the second one is a curly
|
|
|
073263 |
braces expression may fail.
|
|
|
073263 |
Solution: Check for an "=" in a better way. (ZyX)
|
|
|
073263 |
Files: src/eval.c, src/testdir/test104.in, src/testdir/test104.ok
|
|
|
073263 |
|
|
|
073263 |
|
|
|
073263 |
*** ../vim-7.4.228/src/eval.c 2014-03-25 18:23:27.062087691 +0100
|
|
|
073263 |
--- src/eval.c 2014-03-30 16:46:24.464562806 +0200
|
|
|
073263 |
***************
|
|
|
073263 |
*** 1856,1863 ****
|
|
|
073263 |
return;
|
|
|
073263 |
if (argend > arg && argend[-1] == '.') /* for var.='str' */
|
|
|
073263 |
--argend;
|
|
|
073263 |
! expr = vim_strchr(argend, '=');
|
|
|
073263 |
! if (expr == NULL)
|
|
|
073263 |
{
|
|
|
073263 |
/*
|
|
|
073263 |
* ":let" without "=": list variables
|
|
|
073263 |
--- 1856,1864 ----
|
|
|
073263 |
return;
|
|
|
073263 |
if (argend > arg && argend[-1] == '.') /* for var.='str' */
|
|
|
073263 |
--argend;
|
|
|
073263 |
! expr = skipwhite(argend);
|
|
|
073263 |
! if (*expr != '=' && !(vim_strchr((char_u *)"+-.", *expr) != NULL
|
|
|
073263 |
! && expr[1] == '='))
|
|
|
073263 |
{
|
|
|
073263 |
/*
|
|
|
073263 |
* ":let" without "=": list variables
|
|
|
073263 |
***************
|
|
|
073263 |
*** 1886,1897 ****
|
|
|
073263 |
{
|
|
|
073263 |
op[0] = '=';
|
|
|
073263 |
op[1] = NUL;
|
|
|
073263 |
! if (expr > argend)
|
|
|
073263 |
{
|
|
|
073263 |
! if (vim_strchr((char_u *)"+-.", expr[-1]) != NULL)
|
|
|
073263 |
! op[0] = expr[-1]; /* +=, -= or .= */
|
|
|
073263 |
}
|
|
|
073263 |
! expr = skipwhite(expr + 1);
|
|
|
073263 |
|
|
|
073263 |
if (eap->skip)
|
|
|
073263 |
++emsg_skip;
|
|
|
073263 |
--- 1887,1900 ----
|
|
|
073263 |
{
|
|
|
073263 |
op[0] = '=';
|
|
|
073263 |
op[1] = NUL;
|
|
|
073263 |
! if (*expr != '=')
|
|
|
073263 |
{
|
|
|
073263 |
! if (vim_strchr((char_u *)"+-.", *expr) != NULL)
|
|
|
073263 |
! op[0] = *expr; /* +=, -= or .= */
|
|
|
073263 |
! expr = skipwhite(expr + 2);
|
|
|
073263 |
}
|
|
|
073263 |
! else
|
|
|
073263 |
! expr = skipwhite(expr + 1);
|
|
|
073263 |
|
|
|
073263 |
if (eap->skip)
|
|
|
073263 |
++emsg_skip;
|
|
|
073263 |
*** ../vim-7.4.228/src/testdir/test104.in 2014-02-05 22:25:29.982568243 +0100
|
|
|
073263 |
--- src/testdir/test104.in 2014-03-30 16:44:39.432561197 +0200
|
|
|
073263 |
***************
|
|
|
073263 |
*** 1,4 ****
|
|
|
073263 |
! Tests for autoload. vim: set ft=vim ts=8 :
|
|
|
073263 |
|
|
|
073263 |
STARTTEST
|
|
|
073263 |
:so small.vim
|
|
|
073263 |
--- 1,4 ----
|
|
|
073263 |
! Tests for :let. vim: set ft=vim ts=8 :
|
|
|
073263 |
|
|
|
073263 |
STARTTEST
|
|
|
073263 |
:so small.vim
|
|
|
073263 |
***************
|
|
|
073263 |
*** 10,15 ****
|
|
|
073263 |
--- 10,29 ----
|
|
|
073263 |
:catch
|
|
|
073263 |
: $put ='FAIL: ' . v:exception
|
|
|
073263 |
:endtry
|
|
|
073263 |
+ :let a = 1
|
|
|
073263 |
+ :let b = 2
|
|
|
073263 |
+ :for letargs in ['a b', '{0 == 1 ? "a" : "b"}', '{0 == 1 ? "a" : "b"} a', 'a {0 == 1 ? "a" : "b"}']
|
|
|
073263 |
+ : try
|
|
|
073263 |
+ : redir => messages
|
|
|
073263 |
+ : execute 'let' letargs
|
|
|
073263 |
+ : redir END
|
|
|
073263 |
+ : $put ='OK:'
|
|
|
073263 |
+ : $put =split(substitute(messages, '\n', '\0 ', 'g'), '\n')
|
|
|
073263 |
+ : catch
|
|
|
073263 |
+ : $put ='FAIL: ' . v:exception
|
|
|
073263 |
+ : redir END
|
|
|
073263 |
+ : endtry
|
|
|
073263 |
+ :endfor
|
|
|
073263 |
:/^Results/,$wq! test.out
|
|
|
073263 |
ENDTEST
|
|
|
073263 |
|
|
|
073263 |
*** ../vim-7.4.228/src/testdir/test104.ok 2014-02-05 22:25:29.982568243 +0100
|
|
|
073263 |
--- src/testdir/test104.ok 2014-03-30 16:44:39.432561197 +0200
|
|
|
073263 |
***************
|
|
|
073263 |
*** 1,2 ****
|
|
|
073263 |
--- 1,13 ----
|
|
|
073263 |
Results of test104:
|
|
|
073263 |
OK: function('tr')
|
|
|
073263 |
+ OK:
|
|
|
073263 |
+ a #1
|
|
|
073263 |
+ b #2
|
|
|
073263 |
+ OK:
|
|
|
073263 |
+ b #2
|
|
|
073263 |
+ OK:
|
|
|
073263 |
+ b #2
|
|
|
073263 |
+ a #1
|
|
|
073263 |
+ OK:
|
|
|
073263 |
+ a #1
|
|
|
073263 |
+ b #2
|
|
|
073263 |
*** ../vim-7.4.228/src/version.c 2014-03-30 16:11:37.180530823 +0200
|
|
|
073263 |
--- src/version.c 2014-03-30 16:46:39.660563039 +0200
|
|
|
073263 |
***************
|
|
|
073263 |
*** 736,737 ****
|
|
|
073263 |
--- 736,739 ----
|
|
|
073263 |
{ /* Add new patch number below this line */
|
|
|
073263 |
+ /**/
|
|
|
073263 |
+ 229,
|
|
|
073263 |
/**/
|
|
|
073263 |
|
|
|
073263 |
--
|
|
|
073263 |
You have heard the saying that if you put a thousand monkeys in a room with a
|
|
|
073263 |
thousand typewriters and waited long enough, eventually you would have a room
|
|
|
073263 |
full of dead monkeys.
|
|
|
073263 |
(Scott Adams - The Dilbert principle)
|
|
|
073263 |
|
|
|
073263 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
|
073263 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
|
073263 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
|
073263 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|