diff options
-rw-r--r-- | runtime/doc/eval.txt | 19 | ||||
-rw-r--r-- | runtime/doc/options.txt | 41 | ||||
-rw-r--r-- | src/nvim/misc1.c | 6 | ||||
-rw-r--r-- | src/nvim/options.lua | 18 | ||||
-rw-r--r-- | src/nvim/os/shell.c | 2 | ||||
-rw-r--r-- | test/functional/terminal/edit_spec.lua | 3 |
6 files changed, 39 insertions, 50 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 16f9a2ea6e..1ed919a241 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1524,13 +1524,18 @@ v:errors Errors found by assert functions, such as |assert_true()|. list by the assert function. *v:event* *event-variable* -v:event Dictionary of event data for the current |autocommand|. The - available keys differ per event type and are specified at the - documentation for each |event|. The possible keys are: - operator The operation performed. Unlike - |v:operator|, it is set also for an Ex - mode command. For instance, |:yank| is - translated to "|y|". +v:event Dictionary of event data for the current |autocommand|. Valid + only during the autocommand lifetime: storing or passing + `v:event` is invalid. Copy it instead: > + au TextYankPost * let g:foo = deepcopy(v:event) +< Keys vary by event; see the documentation for the specific + event, e.g. |TextYankPost|. + KEY DESCRIPTION ~ + operator The current |operator|. Also set for + Ex commands (unlike |v:operator|). For + example if |TextYankPost| is triggered + by the |:yank| Ex command then + `v:event['operator']` is "y". regcontents Text stored in the register as a |readfile()|-style list of lines. regname Requested register (e.g "x" for "xyy) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index c30a88f48d..42d665b42e 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2765,8 +2765,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'grepprg'* *'gp'* 'grepprg' 'gp' string (default "grep -n ", - Unix: "grep -n $* /dev/null", - Win32: "findstr /n" or "grep -n") + Unix: "grep -n $* /dev/null") global or local to buffer |global-local| Program to use for the |:grep| command. This option may contain '%' and '#' characters, which are expanded like when used in a command- @@ -2781,8 +2780,6 @@ A jump table for the options with a short description can be found at |Q_op|. |:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|. See also the section |:make_makeprg|, since most of the comments there apply equally to 'grepprg'. - For Win32, the default is "findstr /n" if "findstr.exe" can be found, - otherwise it's "grep -n". This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5251,9 +5248,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'shellcmdflag'* *'shcf'* -'shellcmdflag' 'shcf' string (default: "-c"; - Windows, when 'shell' does not - contain "sh" somewhere: "/c") +'shellcmdflag' 'shcf' string (default: "-c"; Windows: "/c") global Flag passed to the shell to execute "!" and ":!" commands; e.g., "bash.exe -c ls" or "cmd.exe /c dir". For Windows @@ -5264,15 +5259,12 @@ A jump table for the options with a short description can be found at |Q_op|. See |option-backslash| about including spaces and backslashes. See |shell-unquoting| which talks about separating this option into multiple arguments. - Also see |dos-shell| for Windows. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. *'shellpipe'* *'sp'* 'shellpipe' 'sp' string (default ">", "| tee", "|& tee" or "2>&1| tee") global - {not available when compiled without the |+quickfix| - feature} String to be used to put the output of the ":make" command in the error file. See also |:make_makeprg|. See |option-backslash| about including spaces and backslashes. @@ -5314,7 +5306,7 @@ A jump table for the options with a short description can be found at |Q_op|. third-party shells on Windows systems, such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need to set this option by the - user. See |dos-shell|. + user. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -5346,7 +5338,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'shellslash'* *'ssl'* *'noshellslash'* *'nossl'* 'shellslash' 'ssl' boolean (default off) global - {only for MSDOS and MS-Windows} + {only for Windows} When set, a forward slash is used when expanding file names. This is useful when a Unix-like shell is used instead of command.com or cmd.exe. Backward slashes can still be typed, but they are changed to @@ -5363,10 +5355,7 @@ A jump table for the options with a short description can be found at |Q_op|. global When on, use temp files for shell commands. When off use a pipe. When using a pipe is not possible temp files are used anyway. - Currently a pipe is only supported on Unix and MS-Windows 2K and - later. You can check it with: > - :if has("filterpipe") -< The advantage of using a pipe is that nobody can read the temp file + The advantage of using a pipe is that nobody can read the temp file and the 'shell' command does not need to support redirection. The advantage of using a temp file is that the file type and encoding can be detected. @@ -5376,8 +5365,7 @@ A jump table for the options with a short description can be found at |Q_op|. |system()| does not respect this option, it always uses pipes. *'shellxescape'* *'sxe'* -'shellxescape' 'sxe' string (default: ""; - for Windows: "\"&|<>()@^") +'shellxescape' 'sxe' string (default: ""; Windows: "\"&|<>()@^") global When 'shellxquote' is set to "(" then the characters listed in this option will be escaped with a '^' character. This makes it possible @@ -5402,7 +5390,7 @@ A jump table for the options with a short description can be found at |Q_op|. strips off the first and last quote on a command, or 3rd-party shells such as the MKS Korn Shell or bash, where it should be "\"". The default is adjusted according the value of 'shell', to reduce the need - to set this option by the user. See |dos-shell|. + to set this option by the user. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. @@ -6413,8 +6401,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'title'* *'notitle'* 'title' boolean (default off, on when title can be restored) global - {not available when compiled without the |+title| - feature} When on, the title of the window will be set to the value of 'titlestring' (if it is not empty), or to: filename [+=-] (path) - VIM @@ -6426,16 +6412,10 @@ A jump table for the options with a short description can be found at |Q_op|. =+ indicates the file is read-only and modified (path) is the path of the file being edited - VIM the server name |v:servername| or "VIM" - Only works if the terminal supports setting window titles - (currently Win32 console, all GUI versions and terminals with a non- - empty 't_ts' option - this is Unix xterm by default, where 't_ts' is - taken from the builtin termcap). *'titlelen'* 'titlelen' number (default 85) global - {not available when compiled without the |+title| - feature} Gives the percentage of 'columns' to use for the length of the window title. When the title is longer, only the end of the path name is shown. A '<' character before the path name is used to indicate this. @@ -6449,8 +6429,6 @@ A jump table for the options with a short description can be found at |Q_op|. *'titleold'* 'titleold' string (default "Thanks for flying Vim") global - {only available when compiled with the |+title| - feature} This option will be used for the window title when exiting Vim if the original title cannot be restored. Only happens if 'title' is on or 'titlestring' is not empty. @@ -6459,13 +6437,8 @@ A jump table for the options with a short description can be found at |Q_op|. *'titlestring'* 'titlestring' string (default "") global - {not available when compiled without the |+title| - feature} When this option is not empty, it will be used for the title of the window. This happens only when the 'title' option is on. - Only works if the terminal supports setting window titles (currently - Win32 console, all GUI versions and terminals with a non-empty 't_ts' - option). When this option contains printf-style '%' items, they will be expanded according to the rules used for 'statusline'. Example: > diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 0b74b4437e..8d93505be3 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -2678,7 +2678,8 @@ void fast_breakcheck(void) } } -// Call shell. Calls os_call_shell, with 'shellxquote' added. +// os_call_shell wrapper. Handles 'verbose', :profile, and v:shell_error. +// Invalidates cached tags. int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) { int retval; @@ -2686,8 +2687,7 @@ int call_shell(char_u *cmd, ShellOpts opts, char_u *extra_shell_arg) if (p_verbose > 3) { verbose_enter(); - smsg(_("Calling shell to execute: \"%s\""), - cmd == NULL ? p_sh : cmd); + smsg(_("Calling shell to execute: \"%s\""), cmd == NULL ? p_sh : cmd); ui_putc('\n'); verbose_leave(); } diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 4ca63f2efe..774c39808f 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2051,7 +2051,11 @@ return { secure=true, vi_def=true, varname='p_srr', - defaults={if_true={vi=">"}} + defaults={ + condition='WIN32', + if_true={vi=">%s 2>&1"}, + if_false={vi=">"} + } }, { full_name='shellslash', abbreviation='ssl', @@ -2073,7 +2077,11 @@ return { secure=true, vi_def=true, varname='p_sxq', - defaults={if_true={vi=""}} + defaults={ + condition='WIN32', + if_true={vi="("}, + if_false={vi=""} + } }, { full_name='shellxescape', abbreviation='sxe', @@ -2081,7 +2089,11 @@ return { secure=true, vi_def=true, varname='p_sxe', - defaults={if_true={vi=""}} + defaults={ + condition='WIN32', + if_true={vi='"&|<>()@^'}, + if_false={vi=""} + } }, { full_name='shiftround', abbreviation='sr', diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index b449cc3d5a..5cc9d4b79b 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -124,11 +124,9 @@ int os_call_shell(char_u *cmd, ShellOpts opts, char_u *extra_args) } size_t nread; - int exitcode = do_os_system(shell_build_argv((char *)cmd, (char *)extra_args), input.data, input.len, output_ptr, &nread, emsg_silent, forward_output); - xfree(input.data); if (output) { diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index 42a5c768bb..f691a58f6c 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -8,6 +8,7 @@ local command = helpers.command local meths = helpers.meths local clear = helpers.clear local eq = helpers.eq +local iswin = helpers.iswin describe(':edit term://*', function() local get_screen = function(columns, lines) @@ -46,7 +47,7 @@ describe(':edit term://*', function() local winheight = curwinmeths.get_height() local buf_cont_start = rep_size - sb - winheight + 2 local function bufline (i) - return ('%d: foobar'):format(i) + return (iswin() and '%d: (foobar)' or '%d: foobar'):format(i) end for i = buf_cont_start,(rep_size - 1) do bufcontents[#bufcontents + 1] = bufline(i) |