jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.427

3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.427
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.427
3ef2ca
Problem:    When an InsertCharPre autocommand executes system() typeahead may
3ef2ca
	    be echoed and messes up the display. (Jacob Niehus)
3ef2ca
Solution:   Do not set cooked mode when invoked from ":silent".
3ef2ca
Files:	    src/eval.c, runtime/doc/eval.txt
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.426/src/eval.c	2014-08-29 09:46:04.262404970 +0200
3ef2ca
--- src/eval.c	2014-08-29 15:37:57.034451088 +0200
3ef2ca
***************
3ef2ca
*** 18594,18599 ****
3ef2ca
--- 18594,18600 ----
3ef2ca
      int		err = FALSE;
3ef2ca
      FILE	*fd;
3ef2ca
      list_T	*list = NULL;
3ef2ca
+     int		flags = SHELL_SILENT;
3ef2ca
  
3ef2ca
      rettv->v_type = VAR_STRING;
3ef2ca
      rettv->vval.v_string = NULL;
3ef2ca
***************
3ef2ca
*** 18643,18648 ****
3ef2ca
--- 18644,18654 ----
3ef2ca
  	}
3ef2ca
      }
3ef2ca
  
3ef2ca
+     /* Omit SHELL_COOKED when invoked with ":silent".  Avoids that the shell
3ef2ca
+      * echoes typeahead, that messes up the display. */
3ef2ca
+     if (!msg_silent)
3ef2ca
+ 	flags += SHELL_COOKED;
3ef2ca
+ 
3ef2ca
      if (retlist)
3ef2ca
      {
3ef2ca
  	int		len;
3ef2ca
***************
3ef2ca
*** 18652,18659 ****
3ef2ca
  	char_u		*end;
3ef2ca
  	int		i;
3ef2ca
  
3ef2ca
! 	res = get_cmd_output(get_tv_string(&argvars[0]), infile,
3ef2ca
! 					   SHELL_SILENT | SHELL_COOKED, &len;;
3ef2ca
  	if (res == NULL)
3ef2ca
  	    goto errret;
3ef2ca
  
3ef2ca
--- 18658,18664 ----
3ef2ca
  	char_u		*end;
3ef2ca
  	int		i;
3ef2ca
  
3ef2ca
! 	res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len;;
3ef2ca
  	if (res == NULL)
3ef2ca
  	    goto errret;
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 18694,18701 ****
3ef2ca
      }
3ef2ca
      else
3ef2ca
      {
3ef2ca
! 	res = get_cmd_output(get_tv_string(&argvars[0]), infile,
3ef2ca
! 					   SHELL_SILENT | SHELL_COOKED, NULL);
3ef2ca
  #ifdef USE_CR
3ef2ca
  	/* translate <CR> into <NL> */
3ef2ca
  	if (res != NULL)
3ef2ca
--- 18699,18705 ----
3ef2ca
      }
3ef2ca
      else
3ef2ca
      {
3ef2ca
! 	res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
3ef2ca
  #ifdef USE_CR
3ef2ca
  	/* translate <CR> into <NL> */
3ef2ca
  	if (res != NULL)
3ef2ca
*** ../vim-7.4.426/runtime/doc/eval.txt	2014-08-06 14:52:05.035236174 +0200
3ef2ca
--- runtime/doc/eval.txt	2014-08-29 15:49:48.918452643 +0200
3ef2ca
***************
3ef2ca
*** 6071,6076 ****
3ef2ca
--- 6093,6104 ----
3ef2ca
  		list items converted to NULs).  
3ef2ca
  		Pipes are not used.
3ef2ca
  
3ef2ca
+ 		When prepended by |:silent| the shell will not be set to
3ef2ca
+ 		cooked mode.  This is meant to be used for commands that do
3ef2ca
+ 		not need the user to type.  It avoids stray characters showing
3ef2ca
+ 		up on the screen which require |CTRL-L| to remove. >
3ef2ca
+ 			:silent let f = system('ls *.vim')
3ef2ca
+ <
3ef2ca
  		Note: Use |shellescape()| or |::S| with |expand()| or 
3ef2ca
  		|fnamemodify()| to escape special characters in a command 
3ef2ca
  		argument.  Newlines in {expr} may cause the command to fail.  
3ef2ca
*** ../vim-7.4.426/src/version.c	2014-08-29 15:12:50.950447798 +0200
3ef2ca
--- src/version.c	2014-08-29 15:39:07.862451242 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     427,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
How many light bulbs does it take to change a person?
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///