diff options
-rw-r--r-- | src/nvim/ex_cmds.c | 2 | ||||
-rw-r--r-- | test/functional/vimscript/system_spec.lua | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index f6e5d5c665..55d0651930 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1382,7 +1382,7 @@ char *make_filter_cmd(char *cmd, char *itmp, char *otmp) : 0; if (itmp != NULL) { - len += is_pwsh ? strlen(itmp) + sizeof("& { Get-Content " " | & " " }") - 1 + len += is_pwsh ? strlen(itmp) + sizeof("& { Get-Content " " | & " " }") - 1 + 6 // +6: #20530 : strlen(itmp) + sizeof(" { " " < " " } ") - 1; } if (otmp != NULL) { diff --git a/test/functional/vimscript/system_spec.lua b/test/functional/vimscript/system_spec.lua index f099b4a36e..7ada1c4bea 100644 --- a/test/functional/vimscript/system_spec.lua +++ b/test/functional/vimscript/system_spec.lua @@ -662,4 +662,33 @@ describe('shell :!', function() 1]]) end end) + + it(':{range}! without redirecting to buffer', function() + local screen = Screen.new(500, 10) + screen:attach() + insert([[ + 3 + 1 + 4 + 2]]) + feed(':4verbose %w !sort<cr>') + if is_os('win') then + screen:expect{ + any=[[Executing command: .?sort %< .*]] + } + else + screen:expect{ + any=[[Executing command: .?%(sort%) %< .*]] + + } + end + feed('<CR>') + helpers.set_shell_powershell(true) + feed(':4verbose %w !sort<cr>') + screen:expect{ + any=[[Executing command: .?& { Get%-Content .* | & sort }]] + } + feed('<CR>') + helpers.expect_exit(command, 'qall!') + end) end) |