summaryrefslogtreecommitdiffstats
path: root/vim/vim-7.2/7.2.146
blob: 96852fbefb51c069cd63539b8112447fd166cbf1 (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
To: vim-dev@vim.org
Subject: Patch 7.2.146
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.2.146
Problem:    v:warningmsg isn't used for all warnings.
Solution:   Set v:warningmsg for relevant warnings. (Ingo Karkat)
Files:	    src/fileio.c, src/misc1.c, src/option.c


*** ../vim-7.2.145/src/fileio.c	Wed Mar 11 13:09:30 2009
--- src/fileio.c	Wed Mar 18 15:03:46 2009
***************
*** 6647,6652 ****
--- 6647,6657 ----
  	    tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
  							+ STRLEN(mesg2) + 2));
  	    sprintf((char *)tbuf, mesg, path);
+ #ifdef FEAT_EVAL
+ 	    /* Set warningmsg here, before the unimportant and output-specific
+ 	     * mesg2 has been appended. */
+ 	    set_vim_var_string(VV_WARNINGMSG, tbuf, -1);
+ #endif
  #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
  	    if (can_reload)
  	    {
*** ../vim-7.2.145/src/misc1.c	Thu Nov 20 17:09:09 2008
--- src/misc1.c	Wed Mar 18 15:06:59 2009
***************
*** 2955,2960 ****
--- 2955,2962 ----
      int	    col;		/* column for message; non-zero when in insert
  				   mode and 'showmode' is on */
  {
+     static char *w_readonly = N_("W10: Warning: Changing a readonly file");
+ 
      if (curbuf->b_did_warn == FALSE
  	    && curbufIsChanged() == 0
  #ifdef FEAT_AUTOCMD
***************
*** 2977,2984 ****
  	if (msg_row == Rows - 1)
  	    msg_col = col;
  	msg_source(hl_attr(HLF_W));
! 	MSG_PUTS_ATTR(_("W10: Warning: Changing a readonly file"),
! 						   hl_attr(HLF_W) | MSG_HIST);
  	msg_clr_eos();
  	(void)msg_end();
  	if (msg_silent == 0 && !silent_mode)
--- 2979,2988 ----
  	if (msg_row == Rows - 1)
  	    msg_col = col;
  	msg_source(hl_attr(HLF_W));
! 	MSG_PUTS_ATTR(_(w_readonly), hl_attr(HLF_W) | MSG_HIST);
! #ifdef FEAT_EVAL
! 	set_vim_var_string(VV_WARNINGMSG, (char_u *)_(w_readonly), -1);
! #endif
  	msg_clr_eos();
  	(void)msg_end();
  	if (msg_silent == 0 && !silent_mode)
*** ../vim-7.2.145/src/option.c	Wed Mar 18 14:19:28 2009
--- src/option.c	Wed Mar 18 15:06:11 2009
***************
*** 7563,7571 ****
  	     * set. */
  	    if (STRCMP(p_enc, "utf-8") != 0)
  	    {
  		msg_source(hl_attr(HLF_W));
! 		MSG_ATTR(_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'"),
! 			hl_attr(HLF_W));
  	    }
  
  # ifdef FEAT_MBYTE
--- 7563,7575 ----
  	     * set. */
  	    if (STRCMP(p_enc, "utf-8") != 0)
  	    {
+ 		static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'");
+ 
  		msg_source(hl_attr(HLF_W));
! 		MSG_ATTR(_(w_arabic), hl_attr(HLF_W));
! #ifdef FEAT_EVAL
! 		set_vim_var_string(VV_WARNINGMSG, (char_u *)_(w_arabic), -1);
! #endif
  	    }
  
  # ifdef FEAT_MBYTE
*** ../vim-7.2.145/src/version.c	Wed Mar 18 14:30:46 2009
--- src/version.c	Wed Mar 18 15:38:27 2009
***************
*** 678,679 ****
--- 678,681 ----
  {   /* Add new patch number below this line */
+ /**/
+     146,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
238. You think faxes are old-fashioned.

 /// 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    ///