neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 70b1b15144565649731c4eddbcf7c8097784f19f
parent db2a54996ecfb4138301ddb091f537c0a90a9bd4
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Thu,  5 Feb 2026 06:26:59 +0800

test(tui_spec): check that 'ttimeoutlen' works (#37702)


Diffstat:
Mtest/functional/terminal/tui_spec.lua | 54+++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua @@ -834,6 +834,58 @@ describe('TUI', function() ]]) end) + it("split sequences work within 'ttimeoutlen' time", function() + poke_both_eventloop() -- Make sure startup requests have finished. + child_session:request('nvim_set_option_value', 'ttimeoutlen', 250, {}) + feed_data('i') + screen:expect([[ + ^ | + {100:~ }|*3 + {3:[No Name] }| + {5:-- INSERT --} | + {5:-- TERMINAL --} | + ]]) + -- Split UTF-8 '⌂' character + feed_data('\226') + screen:expect_unchanged(false, 25) + feed_data('\140') + screen:expect_unchanged(false, 25) + feed_data('\130') + screen:expect([[ + ⌂^ | + {100:~ }|*3 + {3:[No Name] [+] }| + {5:-- INSERT --} | + {5:-- TERMINAL --} | + ]]) + -- Split CSI u escape sequence for Ctrl-X + feed_data('\027') + screen:expect_unchanged(false, 25) + feed_data('[') + screen:expect_unchanged(false, 25) + feed_data('120;') + screen:expect_unchanged(false, 25) + feed_data('5u') + screen:expect([[ + ⌂^ | + {100:~ }|*3 + {3:[No Name] [+] }| + {5:-- ^X mode (^]^D^E^F^I^K^L^N^O^P^Rs^U^V^Y)} | + {5:-- TERMINAL --} | + ]]) + -- <Esc> is sent after 'ttimeoutlen' exceeds. + feed_data('\027') + screen:expect_unchanged(false, 25) + vim.uv.sleep(225) + screen:expect([[ + ^⌂ | + {100:~ }|*3 + {3:[No Name] [+] }| + | + {5:-- TERMINAL --} | + ]]) + end) + it('accepts ASCII control sequences', function() feed_data('i') feed_data('\022\007') -- ctrl+g @@ -1901,7 +1953,7 @@ describe('TUI', function() expect_child_buf_lines({ expected }) end) - it('paste: less-than sign in cmdline #11088', function() + it('paste: less-than sign in cmdline #11088', function() local expected = '<' feed_data(':') wait_for_mode('c')