mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	vim-patch:8.1.1759: no mode char for terminal mapping from maparg()
Problem:    No mode char for terminal mapping from maparg().
Solution:   Check for TERMINAL mode. (closes vim/vim#4735)
14371ed697
			
			
This commit is contained in:
		@@ -3304,6 +3304,8 @@ char *map_mode_to_chars(int mode)
 | 
			
		||||
      ga_append(&mapmode, 'n');                         /* :nmap */
 | 
			
		||||
    if (mode & OP_PENDING)
 | 
			
		||||
      ga_append(&mapmode, 'o');                         /* :omap */
 | 
			
		||||
    if (mode & TERM_FOCUS)
 | 
			
		||||
      ga_append(&mapmode, 't');                         /* :tmap */
 | 
			
		||||
    if ((mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE)
 | 
			
		||||
      ga_append(&mapmode, 'v');                         /* :vmap */
 | 
			
		||||
    else {
 | 
			
		||||
 
 | 
			
		||||
@@ -27,6 +27,10 @@ function Test_maparg()
 | 
			
		||||
  call assert_equal({'silent': 0, 'noremap': 0, 'lhs': 'foo', 'mode': ' ',
 | 
			
		||||
        \ 'nowait': 1, 'expr': 0, 'sid': sid, 'rhs': 'bar', 'buffer': 1},
 | 
			
		||||
        \ maparg('foo', '', 0, 1))
 | 
			
		||||
  tmap baz foo
 | 
			
		||||
  call assert_equal({'silent': 0, 'noremap': 0, 'lhs': 'baz', 'mode': 't',
 | 
			
		||||
        \ 'nowait': 0, 'expr': 0, 'sid': sid, 'rhs': 'foo', 'buffer': 0},
 | 
			
		||||
        \ maparg('baz', 't', 0, 1))
 | 
			
		||||
 | 
			
		||||
  map abc x<char-114>x
 | 
			
		||||
  call assert_equal("xrx", maparg('abc'))
 | 
			
		||||
 
 | 
			
		||||
@@ -346,11 +346,6 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
 | 
			
		||||
    to_return.sid = not opts.sid and 0 or opts.sid
 | 
			
		||||
    to_return.buffer = not opts.buffer and 0 or opts.buffer
 | 
			
		||||
 | 
			
		||||
    -- mode 't' doesn't print when calling maparg
 | 
			
		||||
    if mode == 't' then
 | 
			
		||||
      to_return.mode = ''
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return to_return
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user