@@ -1139,14 +1139,18 @@ describe('on_lines does not emit out-of-bounds line indexes when', function()
11391139end )
11401140
11411141describe (' terminal input' , function ()
1142+ local chan --- @type integer
1143+
11421144 before_each (function ()
11431145 clear ()
1144- exec_lua ([[
1146+ chan = exec_lua (function ()
11451147 _G .input_data = ' '
1146- vim.api.nvim_open_term(0, { on_input = function(_, _, _, data)
1147- _G.input_data = _G.input_data .. data
1148- end })
1149- ]] )
1148+ return vim .api .nvim_open_term (0 , {
1149+ on_input = function (_ , _ , _ , data )
1150+ _G .input_data = _G .input_data .. data
1151+ end ,
1152+ })
1153+ end )
11501154 feed (' i' )
11511155 poke_eventloop ()
11521156 end )
@@ -1160,6 +1164,35 @@ describe('terminal input', function()
11601164 feed (' aaa<Help>bbb' )
11611165 eq (' aaabbb' , exec_lua ([[ return _G.input_data]] ))
11621166 end )
1167+
1168+ it (' <Ignore> is no-op' , function ()
1169+ feed (' aaa<Ignore>bbb' )
1170+ eq (' aaabbb' , exec_lua ([[ return _G.input_data]] ))
1171+ eq ({ mode = ' t' , blocking = false }, api .nvim_get_mode ())
1172+ feed ([[ <C-\><Ignore><C-N>]] )
1173+ eq ({ mode = ' nt' , blocking = false }, api .nvim_get_mode ())
1174+ feed (' v' )
1175+ eq ({ mode = ' v' , blocking = false }, api .nvim_get_mode ())
1176+ feed (' <Esc>' )
1177+ eq ({ mode = ' nt' , blocking = false }, api .nvim_get_mode ())
1178+ feed (' i' )
1179+ eq ({ mode = ' t' , blocking = false }, api .nvim_get_mode ())
1180+ feed ([[ <C-\><Ignore><C-O>]] )
1181+ eq ({ mode = ' ntT' , blocking = false }, api .nvim_get_mode ())
1182+ feed (' v' )
1183+ eq ({ mode = ' v' , blocking = false }, api .nvim_get_mode ())
1184+ feed (' <Esc>' )
1185+ eq ({ mode = ' t' , blocking = false }, api .nvim_get_mode ())
1186+ fn .chanclose (chan )
1187+ feed (' <MouseMove>' )
1188+ eq ({ mode = ' t' , blocking = false }, api .nvim_get_mode ())
1189+ feed (' <Ignore>' )
1190+ eq ({ mode = ' t' , blocking = false }, api .nvim_get_mode ())
1191+ eq (' terminal' , api .nvim_get_option_value (' buftype' , { buf = 0 }))
1192+ feed (' <Space>' )
1193+ eq ({ mode = ' n' , blocking = false }, api .nvim_get_mode ())
1194+ eq (' ' , api .nvim_get_option_value (' buftype' , { buf = 0 }))
1195+ end )
11631196end )
11641197
11651198describe (' terminal input' , function ()
0 commit comments