mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	 2f06413dfb
			
		
	
	2f06413dfb
	
	
	
		
			
			In #8226 <A-x> and <M-x> were changed to behave like <Esc>x in insert mode when no mapping exists. This commit backs out that change and replaces it with a more general one that makes unmapped ALT and META keypresses as <Esc>+char in all modes. This fixes an unnecessary and confusing inconsistency between modes.
		
			
				
	
	
		
			23 lines
		
	
	
		
			616 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			616 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| local helpers = require('test.functional.helpers')(after_each)
 | |
| local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
 | |
| local command = helpers.command
 | |
| local expect = helpers.expect
 | |
| 
 | |
| describe('meta-keys-in-normal-mode', function()
 | |
|   before_each(function()
 | |
|     clear()
 | |
|   end)
 | |
| 
 | |
|   it('ALT/META', function()
 | |
|     -- Unmapped ALT-chords behave as Esc+c
 | |
|     insert('hello')
 | |
|     feed('0<A-x><M-x>')
 | |
|     expect('llo')
 | |
|     -- Mapped ALT-chord behaves as mapped.
 | |
|     command('nnoremap <M-l> Ameta-l<Esc>')
 | |
|     command('nnoremap <A-j> Aalt-j<Esc>')
 | |
|     feed('<A-j><M-l>')
 | |
|     expect('lloalt-jmeta-l')
 | |
|   end)
 | |
| end)
 |