mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
updated for version 7.4.427
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".
This commit is contained in:
@@ -6093,6 +6093,12 @@ system({expr} [, {input}]) *system()* *E677*
|
|||||||
list items converted to NULs).
|
list items converted to NULs).
|
||||||
Pipes are not used.
|
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
|
Note: Use |shellescape()| or |::S| with |expand()| or
|
||||||
|fnamemodify()| to escape special characters in a command
|
|fnamemodify()| to escape special characters in a command
|
||||||
argument. Newlines in {expr} may cause the command to fail.
|
argument. Newlines in {expr} may cause the command to fail.
|
||||||
|
12
src/eval.c
12
src/eval.c
@@ -18594,6 +18594,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
|
|||||||
int err = FALSE;
|
int err = FALSE;
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
list_T *list = NULL;
|
list_T *list = NULL;
|
||||||
|
int flags = SHELL_SILENT;
|
||||||
|
|
||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
rettv->vval.v_string = NULL;
|
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)
|
if (retlist)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
@@ -18652,8 +18658,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
|
|||||||
char_u *end;
|
char_u *end;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
res = get_cmd_output(get_tv_string(&argvars[0]), infile,
|
res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len);
|
||||||
SHELL_SILENT | SHELL_COOKED, &len);
|
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
goto errret;
|
goto errret;
|
||||||
|
|
||||||
@@ -18694,8 +18699,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res = get_cmd_output(get_tv_string(&argvars[0]), infile,
|
res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
|
||||||
SHELL_SILENT | SHELL_COOKED, NULL);
|
|
||||||
#ifdef USE_CR
|
#ifdef USE_CR
|
||||||
/* translate <CR> into <NL> */
|
/* translate <CR> into <NL> */
|
||||||
if (res != NULL)
|
if (res != NULL)
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
427,
|
||||||
/**/
|
/**/
|
||||||
426,
|
426,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user