summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-10-21 16:22:17 +0200
committerBram Moolenaar <Bram@vim.org>2014-10-21 16:22:17 +0200
commitbdef518b0a4691b66c4d483d239e13ef29423d18 (patch)
treeecae7f1aaefeba1160ebbb86983370a36bfe22e9
parentf1b4622366d96c12ff4e01f21358467b4026e016 (diff)
updated for version 7.4.483v7.4.483
Problem: A 0x80 byte is not handled correctly in abbreviations. Solution: Unescape special characters. Add a test. (Christian Brabandt)
-rw-r--r--src/getchar.c16
-rw-r--r--src/testdir/Make_amiga.mak1
-rw-r--r--src/testdir/Make_dos.mak1
-rw-r--r--src/testdir/Make_ming.mak1
-rw-r--r--src/testdir/Make_os2.mak1
-rw-r--r--src/testdir/Make_vms.mms1
-rw-r--r--src/testdir/Makefile1
-rw-r--r--src/testdir/test_mapping.in15
-rw-r--r--src/testdir/test_mapping.ok2
-rw-r--r--src/version.c2
10 files changed, 40 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 9edb767e1b..cc93a7dd81 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4443,6 +4443,7 @@ check_abbr(c, ptr, col, mincol)
#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,6 +4521,19 @@ check_abbr(c, ptr, col, mincol)
#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,7 +4542,7 @@ check_abbr(c, ptr, col, mincol)
{
/* find entries with right mode and keys */
if ( (mp->m_mode & State)
- && mp->m_keylen == len
+ && qlen == len
&& !STRNCMP(mp->m_keys, ptr, (size_t)len))
break;
}
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 5012812448..c0df2c1b56 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -43,6 +43,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_mapping.out \
test_options.out \
test_qf_title.out \
test_utf8.out
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 38264f2eaf..91500439fd 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -42,6 +42,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_mapping.out \
test_options.out \
test_qf_title.out \
test_utf8.out
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 782f89d646..247c0f259d 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -62,6 +62,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_mapping.out \
test_options.out \
test_qf_title.out \
test_utf8.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index d3e833793a..cfade3f7f7 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -44,6 +44,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_mapping.out \
test_options.out \
test_qf_title.out \
test_utf8.out
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 3c7afc346d..6483b7ce3a 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -103,6 +103,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_mapping.out \
test_options.out \
test_qf_title.out \
test_utf8.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 59fe011696..41f25cfbd1 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test_insertcount.out \
test_listlbr.out \
test_listlbr_utf8.out \
+ test_mapping.out \
test_options.out \
test_qf_title.out \
test_utf8.out
diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
new file mode 100644
index 0000000000..55dac09bed
--- /dev/null
+++ b/src/testdir/test_mapping.in
@@ -0,0 +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:
+
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
new file mode 100644
index 0000000000..abdaea6a36
--- /dev/null
+++ b/src/testdir/test_mapping.ok
@@ -0,0 +1,2 @@
+test starts here:
+vim
diff --git a/src/version.c b/src/version.c
index 7540f8ddc4..7d1a1914b6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 483,
+/**/
482,
/**/
481,