'inccommand': fix 'gdefault' lockup #7261

closes #7244
ref #7249
This commit is contained in:
KillTheMule
2017-09-09 11:38:19 +02:00
committed by Justin M. Keyes
parent d2cbc31185
commit 6d0f87a0bd
2 changed files with 57 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ local neq = helpers.neq
local ok = helpers.ok
local source = helpers.source
local wait = helpers.wait
local nvim = helpers.nvim
local default_text = [[
Inc substitution on
@@ -1647,3 +1648,29 @@ describe("'inccommand' split windows", function()
end)
end)
describe("'inccommand' with 'gdefault'", function()
before_each(function()
clear()
end)
it("does not lock up #7244", function()
common_setup(nil, "nosplit", "{")
command("set gdefault")
feed(":s/{\\n")
eq({mode='c', blocking=false}, nvim("get_mode"))
feed("/A<Enter>")
expect("A")
eq({mode='n', blocking=false}, nvim("get_mode"))
end)
it("with multiline text and range, does not lock up #7244", function()
common_setup(nil, "nosplit", "{\n\n{")
command("set gdefault")
feed(":%s/{\\n")
eq({mode='c', blocking=false}, nvim("get_mode"))
feed("/A<Enter>")
expect("A\nA")
eq({mode='n', blocking=false}, nvim("get_mode"))
end)
end)