Patch 8.1.2113
Problem:    ":help expr-!~?" only works after searching.
Solution:   Escape "~" after "expr-". (closes #5015)
Files:      src/ex_cmds.c, src/testdir/test_help.vim


*** ../vim-8.1.2112/src/ex_cmds.c       2019-10-01 12:10:19.951160320 +0200
--- src/ex_cmds.c       2019-10-05 11:28:09.056083506 +0200
***************
*** 5547,5558 ****
      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.
        for (i = (int)(sizeof(expr_table) / sizeof(char *)); --i >= 0; )
            if (STRCMP(arg + 5, expr_table[i]) == 0)
            {
!               STRCPY(d, arg);
                break;
            }
      }
--- 5547,5568 ----
      if (STRNICMP(arg, "expr-", 5) == 0)
      {
        // When the string starting with "expr-" and containing '?' and matches
!       // the table, it is taken literally (but ~ is escaped).  Otherwise '?'
!       // is recognized as a wildcard.
        for (i = (int)(sizeof(expr_table) / sizeof(char *)); --i >= 0; )
            if (STRCMP(arg + 5, expr_table[i]) == 0)
            {
!               int si = 0, di = 0;
! 
!               for (;;)
!               {
!                   if (arg[si] == '~')
!                       d[di++] = '\\';
!                   d[di++] = arg[si];
!                   if (arg[si] == NUL)
!                       break;
!                   ++si;
!               }
                break;
            }
      }
*** ../vim-8.1.2112/src/testdir/test_help.vim   2017-12-09 20:53:57.000000000 
+0100
--- src/testdir/test_help.vim   2019-10-05 11:27:27.200318812 +0200
***************
*** 20,25 ****
--- 20,31 ----
    bwipe!
  endfunc
  
+ func Test_help_expr()
+   help expr-!~?
+   call assert_equal('eval.txt', expand('%:t'))
+   close
+ endfunc
+ 
  func Test_help_keyword()
    new
    set keywordprg=:help
*** ../vim-8.1.2112/src/version.c       2019-10-04 21:29:01.748385911 +0200
--- src/version.c       2019-10-05 11:28:44.603883331 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     2113,
  /**/

-- 
Michael: There is no such thing as a dump question.
Bernard: Sure there is.  For example "what is a core dump?"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201910050957.x959vqVg021982%40masaka.moolenaar.net.

Raspunde prin e-mail lui