local helpers = require('test.functional.helpers')(after_each) local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local command = helpers.command local eq = helpers.eq local expect = helpers.expect local funcs = helpers.funcs describe('insert-mode', function() before_each(function() clear() end) it('CTRL-@', function() -- Inserts last-inserted text, leaves insert-mode. insert('hello') feed('ix') expect('hellhello') -- C-Space is the same as C-@. -- CTRL-SPC inserts last-inserted text, leaves insert-mode. feed('ix') expect('hellhellhello') -- CTRL-A inserts last inserted text feed('ix') expect('hellhellhellhelloxo') end) it('ALT/META #8213', function() -- Mapped ALT-chord behaves as mapped. command('inoremap meta-l') command('inoremap alt-j') feed('i xxx a') expect('meta-l xxx alt-j') eq({ 0, 1, 14, 0, }, funcs.getpos('.')) -- Unmapped ALT-chord behaves as ESC+c. command('iunmap ') feed('0i') eq({ 0, 1, 2, 0, }, funcs.getpos('.')) end) end)