diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-10-21 16:22:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-10-21 16:22:17 +0200 |
commit | bdef518b0a4691b66c4d483d239e13ef29423d18 (patch) | |
tree | ecae7f1aaefeba1160ebbb86983370a36bfe22e9 /src/getchar.c | |
parent | f1b4622366d96c12ff4e01f21358467b4026e016 (diff) | |
download | vim-git-bdef518b0a4691b66c4d483d239e13ef29423d18.tar.gz |
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)
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/getchar.c b/src/getchar.c index 9edb767e1..cc93a7dd8 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; } |