summaryrefslogtreecommitdiff
path: root/source/ap/vim/patches/7.2.337
blob: e745285451c9d323f4dea486bec48e9731c4095b (plain)
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
109
110
111
112
To: vim-dev@vim.org
Subject: Patch 7.2.337
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.2.337
Problem:    The :compiler command doesn't function properly when invoked in a
	    function.
Solution:   Add "g:" before "current_compiler". (Yukihiro Nakadaira)
Files:	    src/ex_cmds2.c


*** ../vim-7.2.336/src/ex_cmds2.c	2009-05-16 21:16:12.000000000 +0200
--- src/ex_cmds2.c	2010-01-19 16:02:53.000000000 +0100
***************
*** 2496,2509 ****
  		 * To remain backwards compatible "current_compiler" is always
  		 * used.  A user's compiler plugin may set it, the distributed
  		 * plugin will then skip the settings.  Afterwards set
! 		 * "b:current_compiler" and restore "current_compiler". */
! 		old_cur_comp = get_var_value((char_u *)"current_compiler");
  		if (old_cur_comp != NULL)
  		    old_cur_comp = vim_strsave(old_cur_comp);
  		do_cmdline_cmd((char_u *)
  			      "command -nargs=* CompilerSet setlocal <args>");
  	    }
! 	    do_unlet((char_u *)"current_compiler", TRUE);
  	    do_unlet((char_u *)"b:current_compiler", TRUE);
  
  	    sprintf((char *)buf, "compiler/%s.vim", eap->arg);
--- 2496,2510 ----
  		 * To remain backwards compatible "current_compiler" is always
  		 * used.  A user's compiler plugin may set it, the distributed
  		 * plugin will then skip the settings.  Afterwards set
! 		 * "b:current_compiler" and restore "current_compiler".
! 		 * Explicitly prepend "g:" to make it work in a function. */
! 		old_cur_comp = get_var_value((char_u *)"g:current_compiler");
  		if (old_cur_comp != NULL)
  		    old_cur_comp = vim_strsave(old_cur_comp);
  		do_cmdline_cmd((char_u *)
  			      "command -nargs=* CompilerSet setlocal <args>");
  	    }
! 	    do_unlet((char_u *)"g:current_compiler", TRUE);
  	    do_unlet((char_u *)"b:current_compiler", TRUE);
  
  	    sprintf((char *)buf, "compiler/%s.vim", eap->arg);
***************
*** 2514,2520 ****
  	    do_cmdline_cmd((char_u *)":delcommand CompilerSet");
  
  	    /* Set "b:current_compiler" from "current_compiler". */
! 	    p = get_var_value((char_u *)"current_compiler");
  	    if (p != NULL)
  		set_internal_string_var((char_u *)"b:current_compiler", p);
  
--- 2515,2521 ----
  	    do_cmdline_cmd((char_u *)":delcommand CompilerSet");
  
  	    /* Set "b:current_compiler" from "current_compiler". */
! 	    p = get_var_value((char_u *)"g:current_compiler");
  	    if (p != NULL)
  		set_internal_string_var((char_u *)"b:current_compiler", p);
  
***************
*** 2523,2534 ****
  	    {
  		if (old_cur_comp != NULL)
  		{
! 		    set_internal_string_var((char_u *)"current_compiler",
  								old_cur_comp);
  		    vim_free(old_cur_comp);
  		}
  		else
! 		    do_unlet((char_u *)"current_compiler", TRUE);
  	    }
  	}
      }
--- 2524,2535 ----
  	    {
  		if (old_cur_comp != NULL)
  		{
! 		    set_internal_string_var((char_u *)"g:current_compiler",
  								old_cur_comp);
  		    vim_free(old_cur_comp);
  		}
  		else
! 		    do_unlet((char_u *)"g:current_compiler", TRUE);
  	    }
  	}
      }
*** ../vim-7.2.336/src/version.c	2010-01-19 15:51:29.000000000 +0100
--- src/version.c	2010-01-19 16:11:20.000000000 +0100
***************
*** 683,684 ****
--- 683,686 ----
  {   /* Add new patch number below this line */
+ /**/
+     337,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
121. You ask for e-mail adresses instead of telephone numbers.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///