diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-26 15:05:56 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-04-29 15:51:04 +0800 |
commit | abe91e1efec84c47c03a69ab8a998bb16f628084 (patch) | |
tree | 59814a0125ad7ece7476d9473e25e867e8099339 /src/nvim/viml/parser/expressions.c | |
parent | 6832b626ea1b3413c445dfc23f4d921335dfeaf3 (diff) | |
download | rneovim-abe91e1efec84c47c03a69ab8a998bb16f628084.tar.gz rneovim-abe91e1efec84c47c03a69ab8a998bb16f628084.tar.bz2 rneovim-abe91e1efec84c47c03a69ab8a998bb16f628084.zip |
vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier
Problem: GUI tests fail because the test doesn't use a modifier.
Solution: Add "\{xxx}" to be able to encode a modifier.
https://github.com/vim/vim/commit/ebe9d34aa07037cff2188a8dd424ee1f59cbb0bf
Change macros to enums to use them in unit tests.
Diffstat (limited to 'src/nvim/viml/parser/expressions.c')
-rw-r--r-- | src/nvim/viml/parser/expressions.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/viml/parser/expressions.c b/src/nvim/viml/parser/expressions.c index ec747d56d4..1beae0d003 100644 --- a/src/nvim/viml/parser/expressions.c +++ b/src/nvim/viml/parser/expressions.c @@ -1815,10 +1815,18 @@ static void parse_quoted_string(ParserState *const pstate, ExprASTNode *const no *v_p++ = (char)ch; break; } - // Special key, e.g.: "\<C-W>" - case '<': { + // Special key, e.g.: "\<C-W>" or "\{C-W}" + case '<': + case '{': { + int flags = FSK_KEYCODE | FSK_IN_STRING; + + if (*p == '<') { + flags |= FSK_SIMPLIFY; + } else { + flags |= FSK_CURLY; + } const size_t special_len = trans_special((const char_u **)&p, (size_t)(e - p), - (char_u *)v_p, true, true, true, NULL); + (char_u *)v_p, flags, NULL); if (special_len != 0) { v_p += special_len; } else { |