mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
Prevent prompts during inccommand previews
For example, "Backwards range given, OK to swap (y/n)?" on each keypress.
This commit is contained in:
parent
d52d782389
commit
d04ab11f24
@ -1927,7 +1927,9 @@ static int command_line_changed(CommandLineState *s)
|
||||
// - Immediately undo the effects.
|
||||
State |= CMDPREVIEW;
|
||||
emsg_silent++; // Block error reporting as the command may be incomplete
|
||||
msg_silent++; // Block messages, namely ones that prompt
|
||||
do_cmdline(ccline.cmdbuff, NULL, NULL, DOCMD_KEEPLINE|DOCMD_NOWAIT);
|
||||
msg_silent--; // Unblock messages
|
||||
emsg_silent--; // Unblock error reporting
|
||||
|
||||
// Restore the window "view".
|
||||
|
@ -2582,6 +2582,49 @@ describe(":substitute", function()
|
||||
:%s/some\(thing\)\@!/every/^ |
|
||||
]])
|
||||
end)
|
||||
|
||||
it("doesn't prompt to swap cmd range", function()
|
||||
screen = Screen.new(50, 8) -- wide to avoid hit-enter prompt
|
||||
common_setup(screen, "split", default_text)
|
||||
feed(':2,1s/tw/MO/g')
|
||||
|
||||
-- substitution preview should have been made, without prompting
|
||||
screen:expect([[
|
||||
{12:MO}o lines |
|
||||
{11:[No Name] [+] }|
|
||||
|2| {12:MO}o lines |
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{10:[Preview] }|
|
||||
:2,1s/tw/MO/g^ |
|
||||
]])
|
||||
|
||||
-- but should be prompted on hitting enter
|
||||
feed('<CR>')
|
||||
screen:expect([[
|
||||
{12:MO}o lines |
|
||||
{11:[No Name] [+] }|
|
||||
|2| {12:MO}o lines |
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{10:[Preview] }|
|
||||
{13:Backwards range given, OK to swap (y/n)?}^ |
|
||||
]])
|
||||
|
||||
feed('y')
|
||||
screen:expect([[
|
||||
Inc substitution on |
|
||||
^MOo lines |
|
||||
|
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{15:~ }|
|
||||
{13:Backwards range given, OK to swap (y/n)?}y |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
it(':substitute with inccommand during :terminal activity', function()
|
||||
|
Loading…
Reference in New Issue
Block a user