Hi,

2018-5-29(Tue) 9:28:28 UTC+9 h_east:
> Hi Bram and list,
> 
> `:help -?` will jump to `-+` instead of `-?`.
> 
> Attached patch fixes this.

I found similar issues.
The following help-tag could not jump correctly.
    -?
    q?
    v_g?
    expr-!=?
    expr-!~?
    expr-<=?
    expr-<?
    expr-==?
    expr-=~?
    expr->=?
    expr->?
    expr-is?
    expr-isnot?

Patch updated.
Please check it out.
--
Best regards,
Hirohito Higashi (h_east)

-- 
-- 
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].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 111fe01d2..284c6225d 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6494,6 +6494,7 @@ find_help_tags(
 			       "/*", "/\\*", "\"*", "**",
 			       "cpo-*", "/\\(\\)", "/\\%(\\)",
 			       "?", ":?", "?<CR>", "g?", "g?g?", "g??",
+			       "-?", "q?", "v_g?",
 			       "/\\?", "/\\z(\\)", "\\=", ":s\\=",
 			       "[count]", "[quotex]",
 			       "[range]", ":[range]",
@@ -6504,26 +6505,47 @@ find_help_tags(
 			       "/star", "/\\\\star", "quotestar", "starstar",
 			       "cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)",
 			       "?", ":?", "?<CR>", "g?", "g?g?", "g??",
+			       "-?", "q?", "v_g?",
 			       "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
 			       "\\[count]", "\\[quotex]",
 			       "\\[range]", ":\\[range]",
 			       "\\[pattern]", "\\\\bar", "/\\\\%\\$",
 			       "s/\\\\\\~", "s/\\\\U", "s/\\\\L",
 			       "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"};
+    static char *(expr_excla[]) = {
+	"!=?", "!~?", "<=?", "<?", "==?", "=~?", ">=?", ">?", "is?", "isnot?"
+    };
     int flags;
 
     d = IObuff;		    /* assume IObuff is long enough! */
 
-    /*
-     * Recognize a few exceptions to the rule.	Some strings that contain '*'
-     * with "star".  Otherwise '*' is recognized as a wildcard.
-     */
-    for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
-	if (STRCMP(arg, mtable[i]) == 0)
-	{
-	    STRCPY(d, rtable[i]);
-	    break;
-	}
+    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_excla) / sizeof(char *)); --i >= 0; )
+	    if (STRCMP(arg + 5, expr_excla[i]) == 0)
+	    {
+		STRCPY(d, arg);
+		break;
+	    }
+    }
+    else
+    {
+	/*
+	 * Recognize a few exceptions to the rule.  Some strings that contain
+	 * '*' with "star".  Otherwise '*' is recognized as a wildcard.
+	 */
+	for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
+	    if (STRCMP(arg, mtable[i]) == 0)
+	    {
+		STRCPY(d, rtable[i]);
+		break;
+	    }
+    }
 
     if (i < 0)	/* no match in table */
     {
diff --git a/src/testdir/test_help_tagjump.vim b/src/testdir/test_help_tagjump.vim
index 51b006c57..46aa6a1ca 100644
--- a/src/testdir/test_help_tagjump.vim
+++ b/src/testdir/test_help_tagjump.vim
@@ -26,6 +26,34 @@ func Test_help_tagjump()
   call assert_true(getline('.') =~ '\*:?\*')
   helpclose
 
+  help q?
+  call assert_equal("help", &filetype)
+  call assert_true(getline('.') =~ '\*q?\*')
+  call assert_true(expand('<cword>') == 'q?')
+  helpclose
+
+  help -?
+  call assert_equal("help", &filetype)
+  call assert_true(getline('.') =~ '\*-?\*')
+  helpclose
+
+  help v_g?
+  call assert_equal("help", &filetype)
+  call assert_true(getline('.') =~ '\*v_g?\*')
+  helpclose
+
+  help expr-!=?
+  call assert_equal("help", &filetype)
+  call assert_true(getline('.') =~ '\*expr-!=?\*')
+  call assert_true(expand('<cword>') == 'expr-!=?')
+  helpclose
+
+  help expr-isnot?
+  call assert_equal("help", &filetype)
+  call assert_true(getline('.') =~ '\*expr-isnot?\*')
+  call assert_true(expand('<cword>') == 'expr-isnot?')
+  helpclose
+
   help FileW*Post
   call assert_equal("help", &filetype)
   call assert_true(getline('.') =~ '\*FileWritePost\*')

Raspunde prin e-mail lui