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