mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
parent
739bc5124a
commit
04b3c32772
@ -3478,6 +3478,10 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout)
|
|||||||
else
|
else
|
||||||
++matchcol;
|
++matchcol;
|
||||||
}
|
}
|
||||||
|
// match will be pushed to preview_lines, bring it into a proper state
|
||||||
|
current_match.start.col = matchcol;
|
||||||
|
current_match.end.lnum = sub_firstlnum;
|
||||||
|
current_match.end.col = matchcol;
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1791,6 +1791,42 @@ describe("'inccommand' with 'gdefault'", function()
|
|||||||
expect("A\nA")
|
expect("A\nA")
|
||||||
eq({mode='n', blocking=false}, nvim("get_mode"))
|
eq({mode='n', blocking=false}, nvim("get_mode"))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("does not crash on zero-width matches #7485", function()
|
||||||
|
common_setup(nil, "split", default_text)
|
||||||
|
command("set gdefault")
|
||||||
|
feed("gg")
|
||||||
|
feed("Vj")
|
||||||
|
feed(":s/\\%V")
|
||||||
|
eq({mode='c', blocking=false}, nvim("get_mode"))
|
||||||
|
feed("<Esc>")
|
||||||
|
eq({mode='n', blocking=false}, nvim("get_mode"))
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("removes highlights after abort for a zero-width match", function()
|
||||||
|
local screen = Screen.new(30,5)
|
||||||
|
common_setup(screen, "nosplit", default_text)
|
||||||
|
command("set gdefault")
|
||||||
|
|
||||||
|
feed(":%s/\\%1c/a/")
|
||||||
|
screen:expect([[
|
||||||
|
{12:a}Inc substitution on |
|
||||||
|
{12:a}two lines |
|
||||||
|
{12:a} |
|
||||||
|
{15:~ }|
|
||||||
|
:%s/\%1c/a/^ |
|
||||||
|
]])
|
||||||
|
|
||||||
|
feed("<Esc>")
|
||||||
|
screen:expect([[
|
||||||
|
Inc substitution on |
|
||||||
|
two lines |
|
||||||
|
^ |
|
||||||
|
{15:~ }|
|
||||||
|
|
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe(":substitute", function()
|
describe(":substitute", function()
|
||||||
|
Loading…
Reference in New Issue
Block a user