summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-10-21 19:35:31 +0200
committerBram Moolenaar <Bram@vim.org>2014-10-21 19:35:31 +0200
commit4920a4427183f1a353394f33402dde5ae4d32c18 (patch)
tree63407bfed0417169cd5d490975ea65a3cb559df8
parentcb5ea1401a048b5c3e0e2c4d3afc72184f3604ad (diff)
downloadvim-git-4920a4427183f1a353394f33402dde5ae4d32c18.tar.gz
updated for version 7.4.485v7.4.485
Problem: Abbreviations don't work. (Toothpik) Solution: Move the length computation inside the for loop. Compare against the unescaped key.
-rw-r--r--src/getchar.c36
-rw-r--r--src/version.c2
2 files changed, 22 insertions, 16 deletions
diff --git a/src/getchar.c b/src/getchar.c
index cafa660c4..c9ee4d051 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4443,7 +4443,6 @@ 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;
@@ -4521,29 +4520,34 @@ 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 = (int)STRLEN(q);
- vim_free(q);
- }
- }
for ( ; mp;
#ifdef FEAT_LOCALMAP
mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
#endif
(mp = mp->m_next))
{
+ int qlen = mp->m_keylen;
+ char_u *q = mp->m_keys;
+ int match;
+
+ if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
+ {
+ /* might have CSI escaped mp->m_keys */
+ q = vim_strsave(mp->m_keys);
+ if (q != NULL)
+ {
+ vim_unescape_csi(q);
+ qlen = (int)STRLEN(q);
+ }
+ }
+
/* find entries with right mode and keys */
- if ( (mp->m_mode & State)
+ match = (mp->m_mode & State)
&& qlen == len
- && !STRNCMP(mp->m_keys, ptr, (size_t)len))
+ && !STRNCMP(q, ptr, (size_t)len);
+ if (q != mp->m_keys)
+ vim_free(q);
+ if (match)
break;
}
if (mp != NULL)
diff --git a/src/version.c b/src/version.c
index e0efbb6c3..774480c00 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 */
/**/
+ 485,
+/**/
484,
/**/
483,