summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.268
blob: 84ab154360c77fa32bbaa0a2593cc5b5d1116219 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
To: vim_dev@googlegroups.com
Subject: Patch 7.4.268
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.268
Problem:    Using exists() on a funcref for a script-local function does not
	    work.
Solution:   Translate <SNR> to the special byte sequence.  Add a test.
Files:	    src/eval.c, src/testdir/test_eval.in, src/testdir/test_eval.ok,
	    src/testdir/test_eval_func.vim, Filelist


*** ../vim-7.4.267/src/eval.c	2014-04-24 17:12:29.580911764 +0200
--- src/eval.c	2014-04-29 13:49:26.759933737 +0200
***************
*** 22275,22280 ****
--- 22275,22288 ----
      {
  	name = vim_strsave(name);
  	*pp = end;
+ 	if (STRNCMP(name, "<SNR>", 5) == 0)
+ 	{
+ 	    /* Change "<SNR>" to the byte sequence. */
+ 	    name[0] = K_SPECIAL;
+ 	    name[1] = KS_EXTRA;
+ 	    name[2] = (int)KE_SNR;
+ 	    mch_memmove(name + 3, name + 5, STRLEN(name + 5) + 1);
+ 	}
  	goto theend;
      }
  
*** ../vim-7.4.267/src/testdir/test_eval.in	2014-04-24 17:12:29.584911764 +0200
--- src/testdir/test_eval.in	2014-04-29 13:59:09.495923525 +0200
***************
*** 180,185 ****
--- 180,188 ----
  :echo g:Foo(2)
  :echo Foo(3)
  :"
+ :" script-local function used in Funcref must exist.
+ :so test_eval_func.vim
+ :"
  :/^start:/+1,$wq! test.out
  :" vim: et ts=4 isk-=\: fmr=???,???
  :call getchar()
*** ../vim-7.4.267/src/testdir/test_eval.ok	2014-04-24 17:12:29.584911764 +0200
--- src/testdir/test_eval.ok	2014-04-29 13:59:39.551922998 +0200
***************
*** 341,343 ****
--- 341,347 ----
  called Foo(1)
  called Foo(2)
  called Foo(3)
+ s:Testje exists: 0
+ func s:Testje exists: 1
+ Bar exists: 1
+ func Bar exists: 1
*** ../vim-7.4.267/src/testdir/test_eval_func.vim	2014-04-29 14:02:08.415920389 +0200
--- src/testdir/test_eval_func.vim	2014-04-29 13:57:34.503925189 +0200
***************
*** 0 ****
--- 1,10 ----
+ " Vim script used in test_eval.in.  Needed for script-local function.
+ 
+ func! s:Testje()
+   return "foo"
+ endfunc
+ let Bar = function('s:Testje')
+ $put ='s:Testje exists: ' . exists('s:Testje')
+ $put ='func s:Testje exists: ' . exists('*s:Testje')
+ $put ='Bar exists: ' . exists('Bar')
+ $put ='func Bar exists: ' . exists('*Bar')
*** ../vim-7.4.267/Filelist	2014-04-05 21:59:35.939178415 +0200
--- Filelist	2014-04-29 13:58:40.207924038 +0200
***************
*** 88,93 ****
--- 88,94 ----
  		src/testdir/test60.vim \
  		src/testdir/test83-tags? \
  		src/testdir/test77a.com \
+ 		src/testdir/test_*.vim \
  		src/testdir/python2/*.py \
  		src/testdir/python3/*.py \
  		src/testdir/pythonx/*.py \
*** ../vim-7.4.267/src/version.c	2014-04-29 12:15:22.860032651 +0200
--- src/version.c	2014-04-29 13:47:32.935935732 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     268,
  /**/

-- 
I AM THANKFUL...
...for the piles of laundry and ironing because it means I
have plenty of clothes to wear.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///