aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/viml/parser/expressions.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-11-30 02:01:49 +0300
committerZyX <kp-pav@yandex.ru>2017-11-30 02:01:49 +0300
commitde45ec0146486c49719ff6f6dcceb4914b471c7a (patch)
treeefeca45f58023f8259511276815243539bffa1a1 /src/nvim/viml/parser/expressions.c
parent36a4f3a259ffa282129b18358cce4130397077c5 (diff)
downloadrneovim-de45ec0146486c49719ff6f6dcceb4914b471c7a.tar.gz
rneovim-de45ec0146486c49719ff6f6dcceb4914b471c7a.tar.bz2
rneovim-de45ec0146486c49719ff6f6dcceb4914b471c7a.zip
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.
Diffstat (limited to 'src/nvim/viml/parser/expressions.c')
-rw-r--r--src/nvim/viml/parser/expressions.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c
index 9773e60bbd..cfcde6bb38 100644
--- a/src/nvim/viml/parser/expressions.c
+++ b/src/nvim/viml/parser/expressions.c
@@ -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