diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-10-06 12:32:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-06 12:32:27 -0700 |
commit | 93bceac9bdf9048bb2f615bb6872b46eb15baab8 (patch) | |
tree | 9534e28cdf579684a35db039709e83bc4f45fb50 /src/nvim/ex_cmds.c | |
parent | 55007180a39e762dad7e80b7cd57fe4630e2e20a (diff) | |
parent | d1abd6513e95a41e41ad570038310087e97f3bb1 (diff) | |
download | rneovim-93bceac9bdf9048bb2f615bb6872b46eb15baab8.tar.gz rneovim-93bceac9bdf9048bb2f615bb6872b46eb15baab8.tar.bz2 rneovim-93bceac9bdf9048bb2f615bb6872b46eb15baab8.zip |
Merge #11157 from janlazo/vim-8.1.2113
vim-patch:8.1.{59, 586, 2113}
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index a3a08a5884..b2d7ded6be 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4739,11 +4739,19 @@ int find_help_tags(const char_u *arg, int *num_matches, char_u ***matches, if (STRNICMP(arg, "expr-", 5) == 0) { // When the string starting with "expr-" and containing '?' and matches - // the table, it is taken literally. Otherwise '?' is recognized as a - // wildcard. + // the table, it is taken literally (but ~ is escaped). Otherwise '?' + // is recognized as a wildcard. for (i = (int)ARRAY_SIZE(expr_table); --i >= 0; ) { if (STRCMP(arg + 5, expr_table[i]) == 0) { - STRCPY(d, arg); + for (int si = 0, di = 0; ; si++) { + if (arg[si] == '~') { + d[di++] = '\\'; + } + d[di++] = arg[si]; + if (arg[si] == NUL) { + break; + } + } break; } } |