keymap: Do not use vim_isIDc in keymap.c

Note: there are three changes to ascii_isident. Reverting first two (in 
find_special_key and first in get_special_key_code) normally fails the new test 
with empty &isident, but reverting the third does not. Hence adding `>` to 
&isident.

Ref vim/vim#2389.
This commit is contained in:
ZyX
2017-11-30 02:01:49 +03:00
parent 36a4f3a259
commit de45ec0146
6 changed files with 44 additions and 17 deletions

View File

@@ -386,13 +386,11 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags)
}
#define ISWORD_OR_AUTOLOAD(x) \
(ASCII_ISALNUM(x) || (x) == AUTOLOAD_CHAR || (x) == '_')
#define ISWORD(x) \
(ASCII_ISALNUM(x) || (x) == '_')
(ascii_isident(x) || (x) == AUTOLOAD_CHAR)
// Environment variable.
case '$': {
CHARREG(kExprLexEnv, ISWORD);
CHARREG(kExprLexEnv, ascii_isident);
break;
}
@@ -408,7 +406,7 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags)
case '_': {
ret.data.var.scope = 0;
ret.data.var.autoload = false;
CHARREG(kExprLexPlainIdentifier, ISWORD);
CHARREG(kExprLexPlainIdentifier, ascii_isident);
// "is" and "isnot" operators.
if (!(flags & kELFlagIsNotCmp)
&& ((ret.len == 2 && memcmp(pline.data, "is", 2) == 0)
@@ -445,7 +443,6 @@ LexExprToken viml_pexpr_next_token(ParserState *const pstate, const int flags)
break;
}
#undef ISWORD
#undef ISWORD_OR_AUTOLOAD
#undef CHARREG