mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(powershell): filter ":!" commands with args #19268
Problem:
Since 0b9664f524
powershell filtered
:[range]! commands with args causes error:
"Start-Process: A positional parameter cannot be found that accepts argument ..."
Solution:
Pass args to Start-Process via `-ArgumentList`.
closes #19250
This commit is contained in:
@@ -630,7 +630,7 @@ end)
|
||||
describe('shell :!', function()
|
||||
before_each(clear)
|
||||
|
||||
it(':{range}! with powershell filter/redirect #16271', function()
|
||||
it(':{range}! with powershell filter/redirect #16271 #19250', function()
|
||||
local screen = Screen.new(500, 8)
|
||||
screen:attach()
|
||||
local found = helpers.set_shell_powershell(true)
|
||||
@@ -639,18 +639,25 @@ describe('shell :!', function()
|
||||
1
|
||||
4
|
||||
2]])
|
||||
feed(':4verbose %!sort<cr>')
|
||||
screen:expect{
|
||||
any=[[Executing command: .?Start%-Process sort %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]]
|
||||
}
|
||||
if iswin() then
|
||||
feed(':4verbose %!sort /R<cr>')
|
||||
screen:expect{
|
||||
any=[[Executing command: .?Start%-Process sort %-ArgumentList "/R" %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]]
|
||||
}
|
||||
else
|
||||
feed(':4verbose %!sort -r<cr>')
|
||||
screen:expect{
|
||||
any=[[Executing command: .?Start%-Process sort %-ArgumentList "%-r" %-RedirectStandardInput .* %-RedirectStandardOutput .* %-NoNewWindow %-Wait]]
|
||||
}
|
||||
end
|
||||
feed('<CR>')
|
||||
if found then
|
||||
-- Not using fake powershell, so we can test the result.
|
||||
expect([[
|
||||
1
|
||||
2
|
||||
4
|
||||
3
|
||||
4]])
|
||||
2
|
||||
1]])
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user