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