lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
3e0a94e
To: vim_dev@googlegroups.com
3e0a94e
Subject: Patch 7.4.204
3e0a94e
Fcc: outbox
3e0a94e
From: Bram Moolenaar <Bram@moolenaar.net>
3e0a94e
Mime-Version: 1.0
3e0a94e
Content-Type: text/plain; charset=UTF-8
3e0a94e
Content-Transfer-Encoding: 8bit
3e0a94e
------------
3e0a94e
3e0a94e
Patch 7.4.204
3e0a94e
Problem:    A mapping where the second byte is 0x80 doesn't work.
3e0a94e
Solution:   Unescape before checking for incomplete multi-byte char. (Nobuhiro
3e0a94e
	    Takasaki)
3e0a94e
Files:	    src/getchar.c, src/testdir/test75.in, src/testdir/test75.ok
3e0a94e
3e0a94e
3e0a94e
*** ../vim-7.4.203/src/getchar.c	2014-02-15 16:17:02.213903042 +0100
3e0a94e
--- src/getchar.c	2014-03-12 20:06:17.944971557 +0100
3e0a94e
***************
3e0a94e
*** 2206,2215 ****
3e0a94e
  #ifdef FEAT_MBYTE
3e0a94e
  				/* Don't allow mapping the first byte(s) of a
3e0a94e
  				 * multi-byte char.  Happens when mapping
3e0a94e
! 				 * <M-a> and then changing 'encoding'. */
3e0a94e
! 				if (has_mbyte && MB_BYTE2LEN(c1)
3e0a94e
! 						  > (*mb_ptr2len)(mp->m_keys))
3e0a94e
! 				    mlen = 0;
3e0a94e
  #endif
3e0a94e
  				/*
3e0a94e
  				 * Check an entry whether it matches.
3e0a94e
--- 2206,2221 ----
3e0a94e
  #ifdef FEAT_MBYTE
3e0a94e
  				/* Don't allow mapping the first byte(s) of a
3e0a94e
  				 * multi-byte char.  Happens when mapping
3e0a94e
! 				 * <M-a> and then changing 'encoding'. Beware
3e0a94e
! 				 * that 0x80 is escaped. */
3e0a94e
! 				{
3e0a94e
! 				    char_u *p1 = mp->m_keys;
3e0a94e
! 				    char_u *p2 = mb_unescape(&p1;;
3e0a94e
! 
3e0a94e
! 				    if (has_mbyte && p2 != NULL
3e0a94e
! 					  && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
3e0a94e
! 					mlen = 0;
3e0a94e
! 				}
3e0a94e
  #endif
3e0a94e
  				/*
3e0a94e
  				 * Check an entry whether it matches.
3e0a94e
*** ../vim-7.4.203/src/testdir/test75.in	2013-11-02 04:19:10.000000000 +0100
3e0a94e
--- src/testdir/test75.in	2014-03-12 20:02:45.932968308 +0100
3e0a94e
***************
3e0a94e
*** 1,8 ****
3e0a94e
--- 1,11 ----
3e0a94e
  Tests for maparg().
3e0a94e
+ Also test utf8 map with a 0x80 byte.
3e0a94e
  
3e0a94e
  STARTTEST
3e0a94e
  :so small.vim
3e0a94e
+ :so mbyte.vim
3e0a94e
  :set cpo-=<
3e0a94e
+ :set encoding=utf8
3e0a94e
  :" Test maparg() with a string result
3e0a94e
  :map foo<C-V> is<F4>foo
3e0a94e
  :vnoremap <script> <buffer> <expr> <silent> bar isbar
3e0a94e
***************
3e0a94e
*** 17,22 ****
3e0a94e
--- 20,39 ----
3e0a94e
  :map abc y<S-char-114>y
3e0a94e
  :call append('$', maparg('abc'))
3e0a94e
  :"
3e0a94e
+ Go?:"
3e0a94e
+ :" Outside of the range, minimum
3e0a94e
+ :inoremap <Char-0x1040> a
3e0a94e
+ :call feedkeys("a\u1040\<Esc>")
3e0a94e
+ :" Inside of the range, minimum
3e0a94e
+ :inoremap <Char-0x103f> b
3e0a94e
+ :call feedkeys("a\u103f\<Esc>")
3e0a94e
+ :" Inside of the range, maximum
3e0a94e
+ :inoremap <Char-0xf03f> c
3e0a94e
+ :call feedkeys("a\uf03f\<Esc>")
3e0a94e
+ :" Outside of the range, maximum
3e0a94e
+ :inoremap <Char-0xf040> d
3e0a94e
+ :call feedkeys("a\uf040\<Esc>")
3e0a94e
+ :"
3e0a94e
  :/^eof/+1,$w! test.out
3e0a94e
  :qa!
3e0a94e
  ENDTEST
3e0a94e
*** ../vim-7.4.203/src/testdir/test75.ok	2013-06-29 13:50:08.000000000 +0200
3e0a94e
--- src/testdir/test75.ok	2014-03-12 20:02:49.780968367 +0100
3e0a94e
***************
3e0a94e
*** 4,6 ****
3e0a94e
--- 4,7 ----
3e0a94e
  {'silent': 0, 'noremap': 0, 'lhs': 'foo', 'mode': ' ', 'nowait': 1, 'expr': 0, 'sid': 0, 'rhs': 'bar', 'buffer': 1}
3e0a94e
  xrx
3e0a94e
  yRy
3e0a94e
+ abcd
3e0a94e
*** ../vim-7.4.203/src/version.c	2014-03-12 19:41:37.100948866 +0100
3e0a94e
--- src/version.c	2014-03-12 20:06:43.684971951 +0100
3e0a94e
***************
3e0a94e
*** 740,741 ****
3e0a94e
--- 740,743 ----
3e0a94e
  {   /* Add new patch number below this line */
3e0a94e
+ /**/
3e0a94e
+     204,
3e0a94e
  /**/
3e0a94e
3e0a94e
-- 
3e0a94e
If you only have a hammer, you tend to see every problem as a nail.
3e0a94e
If you only have MS-Windows, you tend to solve every problem by rebooting.
3e0a94e
3e0a94e
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3e0a94e
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3e0a94e
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3e0a94e
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///