3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.483
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.483
3ef2ca
Problem:    A 0x80 byte is not handled correctly in abbreviations.
3ef2ca
Solution:   Unescape special characters. Add a test. (Christian Brabandt)
3ef2ca
Files:	    src/getchar.c, src/testdir/Make_amiga.mak,
3ef2ca
	    src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
3ef2ca
	    src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
3ef2ca
	    src/testdir/Makefile, src/testdir/test_mapping.in,
3ef2ca
	    src/testdir/test_mapping.ok
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.482/src/getchar.c	2014-10-09 13:36:12.736888764 +0200
3ef2ca
--- src/getchar.c	2014-10-21 16:19:23.907174882 +0200
3ef2ca
***************
3ef2ca
*** 4443,4448 ****
3ef2ca
--- 4443,4449 ----
3ef2ca
  #endif
3ef2ca
      int		is_id = TRUE;
3ef2ca
      int		vim_abbr;
3ef2ca
+     int		qlen;		/* length of q, CSI/K_SPECIAL unescaped */
3ef2ca
  
3ef2ca
      if (typebuf.tb_no_abbr_cnt)	/* abbrev. are not recursive */
3ef2ca
  	return FALSE;
3ef2ca
***************
3ef2ca
*** 4520,4525 ****
3ef2ca
--- 4521,4539 ----
3ef2ca
  #else
3ef2ca
  	mp = first_abbr;
3ef2ca
  #endif
3ef2ca
+ 	qlen = mp->m_keylen;
3ef2ca
+ 	if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
3ef2ca
+ 	{
3ef2ca
+ 	    char_u	*q = vim_strsave(mp->m_keys);
3ef2ca
+ 
3ef2ca
+ 	    /* might have CSI escaped mp->m_keys */
3ef2ca
+ 	    if (q != NULL)
3ef2ca
+ 	    {
3ef2ca
+ 		vim_unescape_csi(q);
3ef2ca
+ 		qlen = STRLEN(q);
3ef2ca
+ 		vim_free(q);
3ef2ca
+ 	    }
3ef2ca
+ 	}
3ef2ca
  	for ( ; mp;
3ef2ca
  #ifdef FEAT_LOCALMAP
3ef2ca
  		mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
3ef2ca
***************
3ef2ca
*** 4528,4534 ****
3ef2ca
  	{
3ef2ca
  	    /* find entries with right mode and keys */
3ef2ca
  	    if (       (mp->m_mode & State)
3ef2ca
! 		    && mp->m_keylen == len
3ef2ca
  		    && !STRNCMP(mp->m_keys, ptr, (size_t)len))
3ef2ca
  		break;
3ef2ca
  	}
3ef2ca
--- 4542,4548 ----
3ef2ca
  	{
3ef2ca
  	    /* find entries with right mode and keys */
3ef2ca
  	    if (       (mp->m_mode & State)
3ef2ca
! 		    && qlen == len
3ef2ca
  		    && !STRNCMP(mp->m_keys, ptr, (size_t)len))
3ef2ca
  		break;
3ef2ca
  	}
3ef2ca
*** ../vim-7.4.482/src/testdir/Make_amiga.mak	2014-08-16 18:36:38.593993280 +0200
3ef2ca
--- src/testdir/Make_amiga.mak	2014-10-21 16:12:45.523174012 +0200
3ef2ca
***************
3ef2ca
*** 43,48 ****
3ef2ca
--- 43,49 ----
3ef2ca
  		test_insertcount.out \
3ef2ca
  		test_listlbr.out \
3ef2ca
  		test_listlbr_utf8.out \
3ef2ca
+ 		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
  		test_utf8.out
3ef2ca
*** ../vim-7.4.482/src/testdir/Make_dos.mak	2014-10-09 15:37:02.492904600 +0200
3ef2ca
--- src/testdir/Make_dos.mak	2014-10-21 16:12:45.523174012 +0200
3ef2ca
***************
3ef2ca
*** 42,47 ****
3ef2ca
--- 42,48 ----
3ef2ca
  		test_insertcount.out \
3ef2ca
  		test_listlbr.out \
3ef2ca
  		test_listlbr_utf8.out \
3ef2ca
+ 		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
  		test_utf8.out
3ef2ca
*** ../vim-7.4.482/src/testdir/Make_ming.mak	2014-08-16 18:36:38.593993280 +0200
3ef2ca
--- src/testdir/Make_ming.mak	2014-10-21 16:12:45.527174012 +0200
3ef2ca
***************
3ef2ca
*** 62,67 ****
3ef2ca
--- 62,68 ----
3ef2ca
  		test_insertcount.out \
3ef2ca
  		test_listlbr.out \
3ef2ca
  		test_listlbr_utf8.out \
3ef2ca
+ 		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
  		test_utf8.out
3ef2ca
*** ../vim-7.4.482/src/testdir/Make_os2.mak	2014-08-16 18:36:38.593993280 +0200
3ef2ca
--- src/testdir/Make_os2.mak	2014-10-21 16:15:40.139174393 +0200
3ef2ca
***************
3ef2ca
*** 44,49 ****
3ef2ca
--- 44,50 ----
3ef2ca
  		test_insertcount.out \
3ef2ca
  		test_listlbr.out \
3ef2ca
  		test_listlbr_utf8.out \
3ef2ca
+ 		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
  		test_utf8.out
3ef2ca
*** ../vim-7.4.482/src/testdir/Make_vms.mms	2014-08-16 18:36:38.597993280 +0200
3ef2ca
--- src/testdir/Make_vms.mms	2014-10-21 16:12:45.527174012 +0200
3ef2ca
***************
3ef2ca
*** 103,108 ****
3ef2ca
--- 103,109 ----
3ef2ca
  	 test_insertcount.out \
3ef2ca
  	 test_listlbr.out \
3ef2ca
  	 test_listlbr_utf8.out \
3ef2ca
+ 	 test_mapping.out \
3ef2ca
  	 test_options.out \
3ef2ca
  	 test_qf_title.out \
3ef2ca
  	 test_utf8.out
3ef2ca
*** ../vim-7.4.482/src/testdir/Makefile	2014-08-16 18:36:38.597993280 +0200
3ef2ca
--- src/testdir/Makefile	2014-10-21 16:16:05.771174449 +0200
3ef2ca
***************
3ef2ca
*** 40,45 ****
3ef2ca
--- 40,46 ----
3ef2ca
  		test_insertcount.out \
3ef2ca
  		test_listlbr.out \
3ef2ca
  		test_listlbr_utf8.out \
3ef2ca
+ 		test_mapping.out \
3ef2ca
  		test_options.out \
3ef2ca
  		test_qf_title.out \
3ef2ca
  		test_utf8.out
3ef2ca
*** ../vim-7.4.482/src/testdir/test_mapping.in	2014-10-21 16:21:48.163175197 +0200
3ef2ca
--- src/testdir/test_mapping.in	2014-10-21 16:12:45.527174012 +0200
3ef2ca
***************
3ef2ca
*** 0 ****
3ef2ca
--- 1,15 ----
3ef2ca
+ Test for mappings and abbreviations
3ef2ca
+ 
3ef2ca
+ STARTTEST
3ef2ca
+ :so small.vim
3ef2ca
+ :so mbyte.vim
3ef2ca
+ : " abbreviations with р (0x80) should work
3ef2ca
+ :inoreab чкпр   vim
3ef2ca
+ GAчкпр 
3ef2ca
+ ?
3ef2ca
+ :/^test/,$w! test.out
3ef2ca
+ :qa!
3ef2ca
+ ENDTEST
3ef2ca
+ 
3ef2ca
+ test starts here:
3ef2ca
+ 
3ef2ca
*** ../vim-7.4.482/src/testdir/test_mapping.ok	2014-10-21 16:21:48.167175197 +0200
3ef2ca
--- src/testdir/test_mapping.ok	2014-10-21 16:12:45.527174012 +0200
3ef2ca
***************
3ef2ca
*** 0 ****
3ef2ca
--- 1,2 ----
3ef2ca
+ test starts here:
3ef2ca
+ vim
3ef2ca
*** ../vim-7.4.482/src/version.c	2014-10-21 14:15:13.419158607 +0200
3ef2ca
--- src/version.c	2014-10-21 16:17:25.139174622 +0200
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     483,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
E  M  A  C  S
3ef2ca
s  e  l  o  h
3ef2ca
c  t  t  n  i
3ef2ca
a  a     t  f
3ef2ca
p        r  t
3ef2ca
e        o
3ef2ca
         l
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///