mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.2113: ":help expr-!~?" only works after searching
Problem: ":help expr-!~?" only works after searching. Solution: Escape "~" after "expr-". (closes #5015)
This commit is contained in:
@@ -5547,12 +5547,22 @@ find_help_tags(
|
|||||||
if (STRNICMP(arg, "expr-", 5) == 0)
|
if (STRNICMP(arg, "expr-", 5) == 0)
|
||||||
{
|
{
|
||||||
// When the string starting with "expr-" and containing '?' and matches
|
// When the string starting with "expr-" and containing '?' and matches
|
||||||
// the table, it is taken literally. Otherwise '?' is recognized as a
|
// the table, it is taken literally (but ~ is escaped). Otherwise '?'
|
||||||
// wildcard.
|
// is recognized as a wildcard.
|
||||||
for (i = (int)(sizeof(expr_table) / sizeof(char *)); --i >= 0; )
|
for (i = (int)(sizeof(expr_table) / sizeof(char *)); --i >= 0; )
|
||||||
if (STRCMP(arg + 5, expr_table[i]) == 0)
|
if (STRCMP(arg + 5, expr_table[i]) == 0)
|
||||||
{
|
{
|
||||||
STRCPY(d, arg);
|
int si = 0, di = 0;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if (arg[si] == '~')
|
||||||
|
d[di++] = '\\';
|
||||||
|
d[di++] = arg[si];
|
||||||
|
if (arg[si] == NUL)
|
||||||
|
break;
|
||||||
|
++si;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,12 @@ func Test_help_errors()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_help_expr()
|
||||||
|
help expr-!~?
|
||||||
|
call assert_equal('eval.txt', expand('%:t'))
|
||||||
|
close
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_help_keyword()
|
func Test_help_keyword()
|
||||||
new
|
new
|
||||||
set keywordprg=:help
|
set keywordprg=:help
|
||||||
|
@@ -753,6 +753,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2113,
|
||||||
/**/
|
/**/
|
||||||
2112,
|
2112,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user