fix(inccommand): do not try to preview an ambiguous command (#18827)

This commit is contained in:
zeertzjq
2022-06-01 20:17:52 +08:00
committed by GitHub
parent c632f64e24
commit f40adf770d
2 changed files with 11 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ local exec_lua = helpers.exec_lua
local insert = helpers.insert
local feed = helpers.feed
local command = helpers.command
local assert_alive = helpers.assert_alive
-- Implements a :Replace command that works like :substitute.
local setup_replace_cmd = [[
@@ -326,4 +327,13 @@ describe("'inccommand' for user commands", function()
:.Replace text cats^ |
]])
end)
it('does not crash on ambiguous command #18825', function()
command('set inccommand=split')
command('command Reply echo 1')
feed(':R')
assert_alive()
feed('e')
assert_alive()
end)
end)