mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user