073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.549
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.549
073263
Problem:    Function name not recognized correctly when inside a function.
073263
Solution:   Don't check for an alpha character.
073263
Files:      src/eval.c, src/testdir/test_nested_function.in,
073263
            src/testdir/test_nested_function.ok, src/testdir/Make_amiga.mak,
073263
            src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
073263
            src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
073263
            src/testdir/Makefile
073263
073263
073263
*** ../vim-7.4.548/src/eval.c	2014-12-07 00:18:27.524203161 +0100
073263
--- src/eval.c	2014-12-13 20:27:16.728347709 +0100
073263
***************
073263
*** 22283,22296 ****
073263
  		if (*p == '!')
073263
  		    p = skipwhite(p + 1);
073263
  		p += eval_fname_script(p);
073263
! 		if (ASCII_ISALPHA(*p))
073263
  		{
073263
! 		    vim_free(trans_function_name(&p, TRUE, 0, NULL));
073263
! 		    if (*skipwhite(p) == '(')
073263
! 		    {
073263
! 			++nesting;
073263
! 			indent += 2;
073263
! 		    }
073263
  		}
073263
  	    }
073263
  
073263
--- 22283,22293 ----
073263
  		if (*p == '!')
073263
  		    p = skipwhite(p + 1);
073263
  		p += eval_fname_script(p);
073263
! 		vim_free(trans_function_name(&p, TRUE, 0, NULL));
073263
! 		if (*skipwhite(p) == '(')
073263
  		{
073263
! 		    ++nesting;
073263
! 		    indent += 2;
073263
  		}
073263
  	    }
073263
  
073263
*** ../vim-7.4.548/src/testdir/test_nested_function.in	2014-12-13 21:00:22.243356614 +0100
073263
--- src/testdir/test_nested_function.in	2014-12-13 20:21:18.080145982 +0100
073263
***************
073263
*** 0 ****
073263
--- 1,34 ----
073263
+ Tests for Nested function                vim: set ft=vim :
073263
+ 
073263
+ STARTTEST
073263
+ :so small.vim
073263
+ :fu! NestedFunc()
073263
+ :  fu! Func1()
073263
+ :    $put ='Func1'
073263
+ :  endfunction
073263
+ :  call Func1()
073263
+ :  fu! s:func2()
073263
+ :    $put ='s:func2'
073263
+ :  endfunction
073263
+ :  call s:func2()
073263
+ :  fu! s:_func3()
073263
+ :    $put ='s:_func3'
073263
+ :  endfunction
073263
+ :  call s:_func3()
073263
+ :  let fn = 'Func4'
073263
+ :  fu! {fn}()
073263
+ :    $put ='Func4'
073263
+ :  endfunction
073263
+ :  call {fn}()
073263
+ :  let fn = 'func5'
073263
+ :  fu! s:{fn}()
073263
+ :    $put ='s:func5'
073263
+ :  endfunction
073263
+ :  call s:{fn}()
073263
+ :endfunction
073263
+ :call NestedFunc()
073263
+ :/^result:/,$w! test.out
073263
+ :qa!
073263
+ ENDTEST
073263
+ 
073263
+ result:
073263
*** ../vim-7.4.548/src/testdir/test_nested_function.ok	2014-12-13 21:00:22.251356529 +0100
073263
--- src/testdir/test_nested_function.ok	2014-12-13 20:21:44.215867748 +0100
073263
***************
073263
*** 0 ****
073263
--- 1,6 ----
073263
+ result:
073263
+ Func1
073263
+ s:func2
073263
+ s:_func3
073263
+ Func4
073263
+ s:func5
073263
*** ../vim-7.4.548/src/testdir/Make_amiga.mak	2014-12-08 04:16:26.253702999 +0100
073263
--- src/testdir/Make_amiga.mak	2014-12-13 20:23:59.554425738 +0100
073263
***************
073263
*** 47,52 ****
073263
--- 47,53 ----
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
  		test_mapping.out \
073263
+ 		test_nested_function.out \
073263
  		test_options.out \
073263
  		test_qf_title.out \
073263
  		test_signs.out \
073263
***************
073263
*** 184,189 ****
073263
--- 185,192 ----
073263
  test_insertcount.out: test_insertcount.in
073263
  test_listlbr.out: test_listlbr.in
073263
  test_listlbr_utf8.out: test_listlbr_utf8.in
073263
+ test_mapping.out: test_mapping.in
073263
+ test_nested_function.out: test_nested_function.in
073263
  test_options.out: test_options.in
073263
  test_qf_title.out: test_qf_title.in
073263
  test_signs.out: test_signs.in
073263
*** ../vim-7.4.548/src/testdir/Make_dos.mak	2014-12-08 04:16:26.253702999 +0100
073263
--- src/testdir/Make_dos.mak	2014-12-13 20:24:11.946293504 +0100
073263
***************
073263
*** 46,51 ****
073263
--- 46,52 ----
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
  		test_mapping.out \
073263
+ 		test_nested_function.out \
073263
  		test_options.out \
073263
  		test_qf_title.out \
073263
  		test_signs.out \
073263
*** ../vim-7.4.548/src/testdir/Make_ming.mak	2014-12-08 04:16:26.253702999 +0100
073263
--- src/testdir/Make_ming.mak	2014-12-13 20:24:17.058237473 +0100
073263
***************
073263
*** 68,73 ****
073263
--- 68,74 ----
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
  		test_mapping.out \
073263
+ 		test_nested_function.out \
073263
  		test_options.out \
073263
  		test_qf_title.out \
073263
  		test_signs.out \
073263
*** ../vim-7.4.548/src/testdir/Make_os2.mak	2014-12-08 04:16:26.253702999 +0100
073263
--- src/testdir/Make_os2.mak	2014-12-13 20:24:21.598190646 +0100
073263
***************
073263
*** 48,53 ****
073263
--- 48,54 ----
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
  		test_mapping.out \
073263
+ 		test_nested_function.out \
073263
  		test_options.out \
073263
  		test_qf_title.out \
073263
  		test_signs.out \
073263
*** ../vim-7.4.548/src/testdir/Make_vms.mms	2014-12-08 04:16:26.253702999 +0100
073263
--- src/testdir/Make_vms.mms	2014-12-13 20:24:29.302110051 +0100
073263
***************
073263
*** 4,10 ****
073263
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
073263
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
073263
  #
073263
! # Last change:  2014 Dec 08
073263
  #
073263
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
073263
  # Edit the lines in the Configuration section below to select.
073263
--- 4,10 ----
073263
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
073263
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
073263
  #
073263
! # Last change:  2014 Dec 13
073263
  #
073263
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
073263
  # Edit the lines in the Configuration section below to select.
073263
***************
073263
*** 107,112 ****
073263
--- 107,113 ----
073263
  	 test_listlbr.out \
073263
  	 test_listlbr_utf8.out \
073263
  	 test_mapping.out \
073263
+ 	 test_nested_function.out \
073263
  	 test_options.out \
073263
  	 test_qf_title.out \
073263
  	 test_signs.out \
073263
*** ../vim-7.4.548/src/testdir/Makefile	2014-12-08 04:16:26.253702999 +0100
073263
--- src/testdir/Makefile	2014-12-13 20:24:42.609966838 +0100
073263
***************
073263
*** 44,49 ****
073263
--- 44,50 ----
073263
  		test_listlbr.out \
073263
  		test_listlbr_utf8.out \
073263
  		test_mapping.out \
073263
+ 		test_nested_function.out \
073263
  		test_options.out \
073263
  		test_qf_title.out \
073263
  		test_signs.out \
073263
*** ../vim-7.4.548/src/version.c	2014-12-13 20:50:01.793994592 +0100
073263
--- src/version.c	2014-12-13 20:56:11.850046569 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     549,
073263
  /**/
073263
073263
-- 
073263
Engineers are always delighted to share wisdom, even in areas in which they
073263
have no experience whatsoever.  Their logic provides them with inherent
073263
insight into any field of expertise.  This can be a problem when dealing with
073263
the illogical people who believe that knowledge can only be derived through
073263
experience.
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    ///