mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.485
Problem: Abbreviations don't work. (Toothpik) Solution: Move the length computation inside the for loop. Compare against the unescaped key. https://code.google.com/p/vim/source/detail?r=v7-4-485
This commit is contained in:
parent
6aecbbebfd
commit
0b192bf990
@ -3573,7 +3573,6 @@ int check_abbr(int c, char_u *ptr, int col, int mincol)
|
|||||||
int clen = 0; /* length in characters */
|
int clen = 0; /* length in characters */
|
||||||
int is_id = TRUE;
|
int is_id = TRUE;
|
||||||
int vim_abbr;
|
int vim_abbr;
|
||||||
int qlen; /* length of q, CSI/K_SPECIAL unescaped */
|
|
||||||
|
|
||||||
if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
|
if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -3636,25 +3635,31 @@ int check_abbr(int c, char_u *ptr, int col, int mincol)
|
|||||||
mp = mp2;
|
mp = mp2;
|
||||||
mp2 = NULL;
|
mp2 = NULL;
|
||||||
}
|
}
|
||||||
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);
|
|
||||||
free(q);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (; mp;
|
for (; mp;
|
||||||
mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
|
mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
|
||||||
(mp = mp->m_next)) {
|
(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 */
|
/* find entries with right mode and keys */
|
||||||
if ( (mp->m_mode & State)
|
match = (mp->m_mode & State)
|
||||||
&& qlen == len
|
&& qlen == len
|
||||||
&& !STRNCMP(mp->m_keys, ptr, (size_t)len))
|
&& !STRNCMP(q, ptr, (size_t)len);
|
||||||
|
if (q != mp->m_keys) {
|
||||||
|
free(q);
|
||||||
|
}
|
||||||
|
if (match) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mp != NULL) {
|
if (mp != NULL) {
|
||||||
/*
|
/*
|
||||||
|
@ -253,7 +253,7 @@ static int included_patches[] = {
|
|||||||
//488,
|
//488,
|
||||||
//487,
|
//487,
|
||||||
//486,
|
//486,
|
||||||
//485,
|
485,
|
||||||
//484 NA
|
//484 NA
|
||||||
483,
|
483,
|
||||||
//482 NA
|
//482 NA
|
||||||
|
Loading…
Reference in New Issue
Block a user