Karsten Hopp 4185d1
To: vim_dev@googlegroups.com
Karsten Hopp 4185d1
Subject: Patch 7.3.285
Karsten Hopp 4185d1
Fcc: outbox
Karsten Hopp 4185d1
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4185d1
Mime-Version: 1.0
Karsten Hopp 4185d1
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 4185d1
Content-Transfer-Encoding: 8bit
Karsten Hopp 4185d1
------------
Karsten Hopp 4185d1
Karsten Hopp 4185d1
Patch 7.3.285 (after 7.3.284)
Karsten Hopp 4185d1
Problem:    Mapping <Char-123> no longer works.
Karsten Hopp 4185d1
Solution:   Properly check for "char-".  Add a test for it.
Karsten Hopp 4185d1
Files:	    src/misc2.c, src/testdir/test75.in, src/testdir/test75.ok
Karsten Hopp 4185d1
Karsten Hopp 4185d1
Karsten Hopp 4185d1
*** ../vim-7.3.284/src/misc2.c	2011-08-17 20:33:18.000000000 +0200
Karsten Hopp 4185d1
--- src/misc2.c	2011-08-19 22:08:37.000000000 +0200
Karsten Hopp 4185d1
***************
Karsten Hopp 4185d1
*** 2781,2786 ****
Karsten Hopp 4185d1
--- 2781,2792 ----
Karsten Hopp 4185d1
  	}
Karsten Hopp 4185d1
  	if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3])
Karsten Hopp 4185d1
  	    bp += 3;	/* skip t_xx, xx may be '-' or '>' */
Karsten Hopp 4185d1
+ 	else if (STRNICMP(bp, "char-", 5) == 0)
Karsten Hopp 4185d1
+ 	{
Karsten Hopp 4185d1
+ 	    vim_str2nr(bp + 5, NULL, &l, TRUE, TRUE, NULL, NULL);
Karsten Hopp 4185d1
+ 	    bp += l + 5;
Karsten Hopp 4185d1
+ 	    break;
Karsten Hopp 4185d1
+ 	}
Karsten Hopp 4185d1
      }
Karsten Hopp 4185d1
  
Karsten Hopp 4185d1
      if (*bp == '>')	/* found matching '>' */
Karsten Hopp 4185d1
***************
Karsten Hopp 4185d1
*** 2810,2836 ****
Karsten Hopp 4185d1
  	    {
Karsten Hopp 4185d1
  		/* <Char-123> or <Char-033> or <Char-0x33> */
Karsten Hopp 4185d1
  		vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n);
Karsten Hopp 4185d1
! 		*modp = modifiers;
Karsten Hopp 4185d1
! 		*srcp = end_of_name;
Karsten Hopp 4185d1
! 		return (int)n;
Karsten Hopp 4185d1
  	    }
Karsten Hopp 4185d1
- 
Karsten Hopp 4185d1
- 	    /*
Karsten Hopp 4185d1
- 	     * Modifier with single letter, or special key name.
Karsten Hopp 4185d1
- 	     */
Karsten Hopp 4185d1
- #ifdef FEAT_MBYTE
Karsten Hopp 4185d1
- 	    if (has_mbyte)
Karsten Hopp 4185d1
- 		l = mb_ptr2len(last_dash + 1);
Karsten Hopp 4185d1
- 	    else
Karsten Hopp 4185d1
- #endif
Karsten Hopp 4185d1
- 		l = 1;
Karsten Hopp 4185d1
- 	    if (modifiers != 0 && last_dash[l + 1] == '>')
Karsten Hopp 4185d1
- 		key = PTR2CHAR(last_dash + 1);
Karsten Hopp 4185d1
  	    else
Karsten Hopp 4185d1
  	    {
Karsten Hopp 4185d1
! 		key = get_special_key_code(last_dash + 1);
Karsten Hopp 4185d1
! 		if (!keep_x_key)
Karsten Hopp 4185d1
! 		    key = handle_x_keys(key);
Karsten Hopp 4185d1
  	    }
Karsten Hopp 4185d1
  
Karsten Hopp 4185d1
  	    /*
Karsten Hopp 4185d1
--- 2816,2842 ----
Karsten Hopp 4185d1
  	    {
Karsten Hopp 4185d1
  		/* <Char-123> or <Char-033> or <Char-0x33> */
Karsten Hopp 4185d1
  		vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n);
Karsten Hopp 4185d1
! 		key = (int)n;
Karsten Hopp 4185d1
  	    }
Karsten Hopp 4185d1
  	    else
Karsten Hopp 4185d1
  	    {
Karsten Hopp 4185d1
! 		/*
Karsten Hopp 4185d1
! 		 * Modifier with single letter, or special key name.
Karsten Hopp 4185d1
! 		 */
Karsten Hopp 4185d1
! #ifdef FEAT_MBYTE
Karsten Hopp 4185d1
! 		if (has_mbyte)
Karsten Hopp 4185d1
! 		    l = mb_ptr2len(last_dash + 1);
Karsten Hopp 4185d1
! 		else
Karsten Hopp 4185d1
! #endif
Karsten Hopp 4185d1
! 		    l = 1;
Karsten Hopp 4185d1
! 		if (modifiers != 0 && last_dash[l + 1] == '>')
Karsten Hopp 4185d1
! 		    key = PTR2CHAR(last_dash + 1);
Karsten Hopp 4185d1
! 		else
Karsten Hopp 4185d1
! 		{
Karsten Hopp 4185d1
! 		    key = get_special_key_code(last_dash + 1);
Karsten Hopp 4185d1
! 		    if (!keep_x_key)
Karsten Hopp 4185d1
! 			key = handle_x_keys(key);
Karsten Hopp 4185d1
! 		}
Karsten Hopp 4185d1
  	    }
Karsten Hopp 4185d1
  
Karsten Hopp 4185d1
  	    /*
Karsten Hopp 4185d1
*** ../vim-7.3.284/src/testdir/test75.in	2010-10-20 21:22:17.000000000 +0200
Karsten Hopp 4185d1
--- src/testdir/test75.in	2011-08-19 22:05:13.000000000 +0200
Karsten Hopp 4185d1
***************
Karsten Hopp 4185d1
*** 2,7 ****
Karsten Hopp 4185d1
--- 2,8 ----
Karsten Hopp 4185d1
  
Karsten Hopp 4185d1
  STARTTEST
Karsten Hopp 4185d1
  :so small.vim
Karsten Hopp 4185d1
+ :set cpo-=<
Karsten Hopp 4185d1
  :" Test maparg() with a string result
Karsten Hopp 4185d1
  :map foo<C-V> is<F4>foo
Karsten Hopp 4185d1
  :vnoremap <script> <buffer> <expr> <silent> bar isbar
Karsten Hopp 4185d1
***************
Karsten Hopp 4185d1
*** 9,14 ****
Karsten Hopp 4185d1
--- 10,20 ----
Karsten Hopp 4185d1
  :call append('$', string(maparg('foo<C-V>', '', 0, 1)))
Karsten Hopp 4185d1
  :call append('$', string(maparg('bar', '', 0, 1)))
Karsten Hopp 4185d1
  :"
Karsten Hopp 4185d1
+ :map abc x<char-114>x
Karsten Hopp 4185d1
+ :call append('$', maparg('abc'))
Karsten Hopp 4185d1
+ :map abc y<S-char-114>y
Karsten Hopp 4185d1
+ :call append('$', maparg('abc'))
Karsten Hopp 4185d1
+ :"
Karsten Hopp 4185d1
  :/^eof/+1,$w! test.out
Karsten Hopp 4185d1
  :qa!
Karsten Hopp 4185d1
  ENDTEST
Karsten Hopp 4185d1
*** ../vim-7.3.284/src/testdir/test75.ok	2010-10-20 21:22:17.000000000 +0200
Karsten Hopp 4185d1
--- src/testdir/test75.ok	2011-08-19 21:53:26.000000000 +0200
Karsten Hopp 4185d1
***************
Karsten Hopp 4185d1
*** 1,3 ****
Karsten Hopp 4185d1
--- 1,5 ----
Karsten Hopp 4185d1
  is<F4>foo
Karsten Hopp 4185d1
  {'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
Karsten Hopp 4185d1
  {'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}
Karsten Hopp 4185d1
+ xrx
Karsten Hopp 4185d1
+ yRy
Karsten Hopp 4185d1
*** ../vim-7.3.284/src/version.c	2011-08-17 20:33:18.000000000 +0200
Karsten Hopp 4185d1
--- src/version.c	2011-08-19 22:15:22.000000000 +0200
Karsten Hopp 4185d1
***************
Karsten Hopp 4185d1
*** 711,712 ****
Karsten Hopp 4185d1
--- 711,714 ----
Karsten Hopp 4185d1
  {   /* Add new patch number below this line */
Karsten Hopp 4185d1
+ /**/
Karsten Hopp 4185d1
+     285,
Karsten Hopp 4185d1
  /**/
Karsten Hopp 4185d1
Karsten Hopp 4185d1
Karsten Hopp 4185d1
-- 
Karsten Hopp 4185d1
No man may purchase alcohol without written consent from his wife.
Karsten Hopp 4185d1
		[real standing law in Pennsylvania, United States of America]
Karsten Hopp 4185d1
Karsten Hopp 4185d1
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4185d1
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4185d1
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 4185d1
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///