Hi Bram,
2018-5-31(Thu) 1:03:55 UTC+9 Bram Moolenaar:
> Hirohito Higashi wrote:
>
> > 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.
>
> Thanks!
Thank you for including my patch by 8.1.0231
https://github.com/vim/vim/commit/a5bc38b8c16be93bac900137a5837585006cc8a4
BTW, Why was it not the second patch but the first patch?
Just to be sure, I attached a patch for 8.1.0233.
--
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 37331519a..ff47d530e 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6583,7 +6583,8 @@ find_help_tags(
static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
"/*", "/\\*", "\"*", "**",
"cpo-*", "/\\(\\)", "/\\%(\\)",
- "?", ":?", "-?", "?<CR>", "g?", "g?g?", "g??",
+ "?", ":?", "?<CR>", "g?", "g?g?", "g??",
+ "-?", "q?", "v_g?",
"/\\?", "/\\z(\\)", "\\=", ":s\\=",
"[count]", "[quotex]",
"[range]", ":[range]",
@@ -6593,27 +6594,48 @@ find_help_tags(
static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star",
"/star", "/\\\\star", "quotestar", "starstar",
"cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)",
- "?", ":?", "-?", "?<CR>", "g?", "g?g?", "g??",
+ "?", ":?", "?<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_question[]) = {
+ "!=?", "!~?", "<=?", "<?", "==?", "=~?", ">=?", ">?", "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_question) / sizeof(char *)); --i >= 0; )
+ if (STRCMP(arg + 5, expr_question[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 00a96b227..46aa6a1ca 100644
--- a/src/testdir/test_help_tagjump.vim
+++ b/src/testdir/test_help_tagjump.vim
@@ -26,11 +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\*')