test(terminal/cursor_spec): fix flaky test (#37681)

(cherry picked from commit 963162b338)
This commit is contained in:
zeertzjq
2026-02-03 13:08:34 +08:00
committed by github-actions[bot]
parent b90b0c8d17
commit ba7456b91a

View File

@@ -551,7 +551,10 @@ describe('buffer cursor position is correct in terminal without number column',
]])
end
before_each(clear)
before_each(function()
clear()
command('autocmd! nvim.terminal')
end)
describe('in a line with no multibyte chars or trailing spaces,', function()
before_each(function()
@@ -864,7 +867,10 @@ describe('buffer cursor position is correct in terminal with number column', fun
before_each(function()
clear()
command('au TermOpen * set number')
command('autocmd! nvim.terminal')
-- 'number' should be set before the terminal process starts, otherwise the resize
-- from setting 'number' may cause a redraw that removes the "Entering Ex mode".
command('set number')
end)
describe('in a line with no multibyte chars or trailing spaces,', function()