lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
7ed73b6
To: vim-dev@vim.org
7ed73b6
Subject: Patch 7.2.146
7ed73b6
Fcc: outbox
7ed73b6
From: Bram Moolenaar <Bram@moolenaar.net>
7ed73b6
Mime-Version: 1.0
7ed73b6
Content-Type: text/plain; charset=ISO-8859-1
7ed73b6
Content-Transfer-Encoding: 8bit
7ed73b6
------------
7ed73b6
7ed73b6
Patch 7.2.146
7ed73b6
Problem:    v:warningmsg isn't used for all warnings.
7ed73b6
Solution:   Set v:warningmsg for relevant warnings. (Ingo Karkat)
7ed73b6
Files:	    src/fileio.c, src/misc1.c, src/option.c
7ed73b6
7ed73b6
7ed73b6
*** ../vim-7.2.145/src/fileio.c	Wed Mar 11 13:09:30 2009
7ed73b6
--- src/fileio.c	Wed Mar 18 15:03:46 2009
7ed73b6
***************
7ed73b6
*** 6647,6652 ****
7ed73b6
--- 6647,6657 ----
7ed73b6
  	    tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg)
7ed73b6
  							+ STRLEN(mesg2) + 2));
7ed73b6
  	    sprintf((char *)tbuf, mesg, path);
7ed73b6
+ #ifdef FEAT_EVAL
7ed73b6
+ 	    /* Set warningmsg here, before the unimportant and output-specific
7ed73b6
+ 	     * mesg2 has been appended. */
7ed73b6
+ 	    set_vim_var_string(VV_WARNINGMSG, tbuf, -1);
7ed73b6
+ #endif
7ed73b6
  #if defined(FEAT_CON_DIALOG) || defined(FEAT_GUI_DIALOG)
7ed73b6
  	    if (can_reload)
7ed73b6
  	    {
7ed73b6
*** ../vim-7.2.145/src/misc1.c	Thu Nov 20 17:09:09 2008
7ed73b6
--- src/misc1.c	Wed Mar 18 15:06:59 2009
7ed73b6
***************
7ed73b6
*** 2955,2960 ****
7ed73b6
--- 2955,2962 ----
7ed73b6
      int	    col;		/* column for message; non-zero when in insert
7ed73b6
  				   mode and 'showmode' is on */
7ed73b6
  {
7ed73b6
+     static char *w_readonly = N_("W10: Warning: Changing a readonly file");
7ed73b6
+ 
7ed73b6
      if (curbuf->b_did_warn == FALSE
7ed73b6
  	    && curbufIsChanged() == 0
7ed73b6
  #ifdef FEAT_AUTOCMD
7ed73b6
***************
7ed73b6
*** 2977,2984 ****
7ed73b6
  	if (msg_row == Rows - 1)
7ed73b6
  	    msg_col = col;
7ed73b6
  	msg_source(hl_attr(HLF_W));
7ed73b6
! 	MSG_PUTS_ATTR(_("W10: Warning: Changing a readonly file"),
7ed73b6
! 						   hl_attr(HLF_W) | MSG_HIST);
7ed73b6
  	msg_clr_eos();
7ed73b6
  	(void)msg_end();
7ed73b6
  	if (msg_silent == 0 && !silent_mode)
7ed73b6
--- 2979,2988 ----
7ed73b6
  	if (msg_row == Rows - 1)
7ed73b6
  	    msg_col = col;
7ed73b6
  	msg_source(hl_attr(HLF_W));
7ed73b6
! 	MSG_PUTS_ATTR(_(w_readonly), hl_attr(HLF_W) | MSG_HIST);
7ed73b6
! #ifdef FEAT_EVAL
7ed73b6
! 	set_vim_var_string(VV_WARNINGMSG, (char_u *)_(w_readonly), -1);
7ed73b6
! #endif
7ed73b6
  	msg_clr_eos();
7ed73b6
  	(void)msg_end();
7ed73b6
  	if (msg_silent == 0 && !silent_mode)
7ed73b6
*** ../vim-7.2.145/src/option.c	Wed Mar 18 14:19:28 2009
7ed73b6
--- src/option.c	Wed Mar 18 15:06:11 2009
7ed73b6
***************
7ed73b6
*** 7563,7571 ****
7ed73b6
  	     * set. */
7ed73b6
  	    if (STRCMP(p_enc, "utf-8") != 0)
7ed73b6
  	    {
7ed73b6
  		msg_source(hl_attr(HLF_W));
7ed73b6
! 		MSG_ATTR(_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'"),
7ed73b6
! 			hl_attr(HLF_W));
7ed73b6
  	    }
7ed73b6
  
7ed73b6
  # ifdef FEAT_MBYTE
7ed73b6
--- 7563,7575 ----
7ed73b6
  	     * set. */
7ed73b6
  	    if (STRCMP(p_enc, "utf-8") != 0)
7ed73b6
  	    {
7ed73b6
+ 		static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'");
7ed73b6
+ 
7ed73b6
  		msg_source(hl_attr(HLF_W));
7ed73b6
! 		MSG_ATTR(_(w_arabic), hl_attr(HLF_W));
7ed73b6
! #ifdef FEAT_EVAL
7ed73b6
! 		set_vim_var_string(VV_WARNINGMSG, (char_u *)_(w_arabic), -1);
7ed73b6
! #endif
7ed73b6
  	    }
7ed73b6
  
7ed73b6
  # ifdef FEAT_MBYTE
7ed73b6
*** ../vim-7.2.145/src/version.c	Wed Mar 18 14:30:46 2009
7ed73b6
--- src/version.c	Wed Mar 18 15:38:27 2009
7ed73b6
***************
7ed73b6
*** 678,679 ****
7ed73b6
--- 678,681 ----
7ed73b6
  {   /* Add new patch number below this line */
7ed73b6
+ /**/
7ed73b6
+     146,
7ed73b6
  /**/
7ed73b6
7ed73b6
-- 
7ed73b6
hundred-and-one symptoms of being an internet addict:
7ed73b6
238. You think faxes are old-fashioned.
7ed73b6
7ed73b6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
7ed73b6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
7ed73b6
\\\        download, build and distribute -- http://www.A-A-P.org        ///
7ed73b6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///