mirror of
https://github.com/neovim/neovim.git
synced 2025-12-06 06:32:33 +00:00
test(tui_spec): prevent another case of race between paste and input (#30481)
Problem: When input immediately follows end of bracketed paste, the
nvim_input may be processed before the nvim_paste.
Solution: Ensure some waiting after the end of a bracketed paste.
This commit is contained in:
@@ -975,6 +975,7 @@ describe('TUI', function()
|
|||||||
{3:-- TERMINAL --} |
|
{3:-- TERMINAL --} |
|
||||||
]])
|
]])
|
||||||
feed_data('\027[201~') -- End paste.
|
feed_data('\027[201~') -- End paste.
|
||||||
|
screen:expect_unchanged()
|
||||||
feed_data('\027[27u') -- ESC: go to Normal mode.
|
feed_data('\027[27u') -- ESC: go to Normal mode.
|
||||||
wait_for_mode('n')
|
wait_for_mode('n')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
@@ -1200,6 +1201,7 @@ describe('TUI', function()
|
|||||||
expect_cmdline('"stuff 1 more"')
|
expect_cmdline('"stuff 1 more"')
|
||||||
-- End the paste sequence.
|
-- End the paste sequence.
|
||||||
feed_data('\027[201~')
|
feed_data('\027[201~')
|
||||||
|
expect_cmdline('"stuff 1 more"')
|
||||||
feed_data(' typed')
|
feed_data(' typed')
|
||||||
expect_cmdline('"stuff 1 more typed"')
|
expect_cmdline('"stuff 1 more typed"')
|
||||||
end)
|
end)
|
||||||
@@ -1243,6 +1245,7 @@ describe('TUI', function()
|
|||||||
feed_data('line 7\nline 8\n')
|
feed_data('line 7\nline 8\n')
|
||||||
-- Stop paste.
|
-- Stop paste.
|
||||||
feed_data('\027[201~')
|
feed_data('\027[201~')
|
||||||
|
screen:expect_unchanged()
|
||||||
feed_data('\n') -- <CR> to dismiss hit-enter prompt
|
feed_data('\n') -- <CR> to dismiss hit-enter prompt
|
||||||
expect_child_buf_lines({ 'foo', '' })
|
expect_child_buf_lines({ 'foo', '' })
|
||||||
-- Dot-repeat/redo is not modified by failed paste.
|
-- Dot-repeat/redo is not modified by failed paste.
|
||||||
@@ -1290,6 +1293,7 @@ describe('TUI', function()
|
|||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
feed_data('\027[200~line A\nline B\n\027[201~')
|
feed_data('\027[200~line A\nline B\n\027[201~')
|
||||||
|
expect_child_buf_lines({ '' })
|
||||||
feed_data('ifoo\n\027[27u')
|
feed_data('ifoo\n\027[27u')
|
||||||
expect_child_buf_lines({ 'foo', '' })
|
expect_child_buf_lines({ 'foo', '' })
|
||||||
end)
|
end)
|
||||||
@@ -1412,7 +1416,6 @@ describe('TUI', function()
|
|||||||
feed_data('\n')
|
feed_data('\n')
|
||||||
-- Send the "stop paste" sequence.
|
-- Send the "stop paste" sequence.
|
||||||
feed_data('\027[201~')
|
feed_data('\027[201~')
|
||||||
|
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
|
|
|
|
||||||
pasted from terminal (1) |
|
pasted from terminal (1) |
|
||||||
|
|||||||
Reference in New Issue
Block a user