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