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