home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.427 < prev    next >
Encoding:
Internet Message Format  |  2014-08-29  |  3.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.427
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.427
  11. Problem:    When an InsertCharPre autocommand executes system() typeahead may
  12.         be echoed and messes up the display. (Jacob Niehus)
  13. Solution:   Do not set cooked mode when invoked from ":silent".
  14. Files:        src/eval.c, runtime/doc/eval.txt
  15.  
  16.  
  17. *** ../vim-7.4.426/src/eval.c    2014-08-29 09:46:04.262404970 +0200
  18. --- src/eval.c    2014-08-29 15:37:57.034451088 +0200
  19. ***************
  20. *** 18594,18599 ****
  21. --- 18594,18600 ----
  22.       int        err = FALSE;
  23.       FILE    *fd;
  24.       list_T    *list = NULL;
  25. +     int        flags = SHELL_SILENT;
  26.   
  27.       rettv->v_type = VAR_STRING;
  28.       rettv->vval.v_string = NULL;
  29. ***************
  30. *** 18643,18648 ****
  31. --- 18644,18654 ----
  32.       }
  33.       }
  34.   
  35. +     /* Omit SHELL_COOKED when invoked with ":silent".  Avoids that the shell
  36. +      * echoes typeahead, that messes up the display. */
  37. +     if (!msg_silent)
  38. +     flags += SHELL_COOKED;
  39.       if (retlist)
  40.       {
  41.       int        len;
  42. ***************
  43. *** 18652,18659 ****
  44.       char_u        *end;
  45.       int        i;
  46.   
  47. !     res = get_cmd_output(get_tv_string(&argvars[0]), infile,
  48. !                        SHELL_SILENT | SHELL_COOKED, &len);
  49.       if (res == NULL)
  50.           goto errret;
  51.   
  52. --- 18658,18664 ----
  53.       char_u        *end;
  54.       int        i;
  55.   
  56. !     res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len);
  57.       if (res == NULL)
  58.           goto errret;
  59.   
  60. ***************
  61. *** 18694,18701 ****
  62.       }
  63.       else
  64.       {
  65. !     res = get_cmd_output(get_tv_string(&argvars[0]), infile,
  66. !                        SHELL_SILENT | SHELL_COOKED, NULL);
  67.   #ifdef USE_CR
  68.       /* translate <CR> into <NL> */
  69.       if (res != NULL)
  70. --- 18699,18705 ----
  71.       }
  72.       else
  73.       {
  74. !     res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
  75.   #ifdef USE_CR
  76.       /* translate <CR> into <NL> */
  77.       if (res != NULL)
  78. *** ../vim-7.4.426/runtime/doc/eval.txt    2014-08-06 14:52:05.035236174 +0200
  79. --- runtime/doc/eval.txt    2014-08-29 15:49:48.918452643 +0200
  80. ***************
  81. *** 6071,6076 ****
  82. --- 6093,6104 ----
  83.           list items converted to NULs).  
  84.           Pipes are not used.
  85.   
  86. +         When prepended by |:silent| the shell will not be set to
  87. +         cooked mode.  This is meant to be used for commands that do
  88. +         not need the user to type.  It avoids stray characters showing
  89. +         up on the screen which require |CTRL-L| to remove. >
  90. +             :silent let f = system('ls *.vim')
  91. + <
  92.           Note: Use |shellescape()| or |::S| with |expand()| or 
  93.           |fnamemodify()| to escape special characters in a command 
  94.           argument.  Newlines in {expr} may cause the command to fail.  
  95. *** ../vim-7.4.426/src/version.c    2014-08-29 15:12:50.950447798 +0200
  96. --- src/version.c    2014-08-29 15:39:07.862451242 +0200
  97. ***************
  98. *** 743,744 ****
  99. --- 743,746 ----
  100.   {   /* Add new patch number below this line */
  101. + /**/
  102. +     427,
  103.   /**/
  104.  
  105. -- 
  106. How many light bulbs does it take to change a person?
  107.  
  108.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  109. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  110. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  111.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  112.