]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.427 v7.4.427
authorBram Moolenaar <Bram@vim.org>
Fri, 29 Aug 2014 13:53:52 +0000 (15:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 29 Aug 2014 13:53:52 +0000 (15:53 +0200)
Problem:    When an InsertCharPre autocommand executes system() typeahead may
            be echoed and messes up the display. (Jacob Niehus)
Solution:   Do not set cooked mode when invoked from ":silent".

runtime/doc/eval.txt
src/eval.c
src/version.c

index 9aa97b7f767114372138d859538685fb19ba516d..688fc38eb8a379aefe9a48183d49c0b3a333a09b 100644 (file)
@@ -6093,6 +6093,12 @@ system({expr} [, {input}])                               *system()* *E677*
                list items converted to NULs).  
                Pipes are not used.
 
+               When prepended by |:silent| the shell will not be set to
+               cooked mode.  This is meant to be used for commands that do
+               not need the user to type.  It avoids stray characters showing
+               up on the screen which require |CTRL-L| to remove. >
+                       :silent let f = system('ls *.vim')
+<
                Note: Use |shellescape()| or |::S| with |expand()| or 
                |fnamemodify()| to escape special characters in a command 
                argument.  Newlines in {expr} may cause the command to fail.  
index a8e94639df05822012f925f7dd8d23acea55ac40..7bf52c5f30c68dd673b8e05da7e38ce0d5c63569 100644 (file)
@@ -18594,6 +18594,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
     int                err = FALSE;
     FILE       *fd;
     list_T     *list = NULL;
+    int                flags = SHELL_SILENT;
 
     rettv->v_type = VAR_STRING;
     rettv->vval.v_string = NULL;
@@ -18643,6 +18644,11 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
        }
     }
 
+    /* Omit SHELL_COOKED when invoked with ":silent".  Avoids that the shell
+     * echoes typeahead, that messes up the display. */
+    if (!msg_silent)
+       flags += SHELL_COOKED;
+
     if (retlist)
     {
        int             len;
@@ -18652,8 +18658,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
        char_u          *end;
        int             i;
 
-       res = get_cmd_output(get_tv_string(&argvars[0]), infile,
-                                          SHELL_SILENT | SHELL_COOKED, &len);
+       res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len);
        if (res == NULL)
            goto errret;
 
@@ -18694,8 +18699,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
     }
     else
     {
-       res = get_cmd_output(get_tv_string(&argvars[0]), infile,
-                                          SHELL_SILENT | SHELL_COOKED, NULL);
+       res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
 #ifdef USE_CR
        /* translate <CR> into <NL> */
        if (res != NULL)
index 0d569f7f9680691c05f993564a12d02c8bd22856..d43534a11c205f097d20b0cf9de964c4e5cb5df4 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    427,
 /**/
     426,
 /**/