patch 9.1.1357: Vim incorrectly escapes tags with "[" in a help buffer

Commit: 
https://github.com/vim/vim/commit/6af20a9be3312045c38ca24b93f2d5d0d70da0b1
Author: Phạm Bình An <phambinhanctb2...@gmail.com>
Date:   Thu May 1 17:30:58 2025 +0200

    patch 9.1.1357: Vim incorrectly escapes tags with "[" in a help buffer
    
    Problem:  Vim incorrectly escapes tags containing "[" in a help buffer
    Solution: check if the buffer has the "help" filetype set, instead of
              already being a help buffer (Phạm Bình An)
    
    fixes: #17224
    closes: #17232
    
    Co-authored-by: Christian Brabandt <c...@256bit.org>
    Co-authored-by: zeertzjq <zeert...@outlook.com>
    Signed-off-by: Phạm Bình An <phambinhanctb2...@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/normal.c b/src/normal.c
index ea30607d6..9231a4c23 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -3579,7 +3579,7 @@ nv_ident(cmdarg_T *cap)
            aux_ptr = (char_u *)(magic_isset() ? "/?.*~[^$\" : "/?^$\");
        else if (tag_cmd)
        {
-           if (curbuf->b_help)
+           if (STRCMP(curbuf->b_p_ft, "help") == 0)
                // ":help" handles unescaped argument
                aux_ptr = (char_u *)"";
            else
diff --git a/src/testdir/test_help.vim b/src/testdir/test_help.vim
index 6c8b3ab39..6422317de 100644
--- a/src/testdir/test_help.vim
+++ b/src/testdir/test_help.vim
@@ -205,5 +205,22 @@ func Test_help_using_visual_match()
   call v9.CheckScriptFailure(lines, 'E149:')
 endfunc
 
+func Test_helptag_navigation()
+  let helpdir = tempname()
+  let tempfile = helpdir . '/test.txt'
+  call mkdir(helpdir, 'pR')
+  call writefile(['', '*[tag*', '', '|[tag|'], tempfile)
+  exe 'helptags' helpdir
+  exe 'sp' tempfile
+  exe 'lcd' helpdir
+  setl ft=help
+  let &l:iskeyword='!-~,^*,^|,^",192-255'
+  call cursor(4, 2)
+  " Vim must not escape `[` when expanding the tag
+  exe "normal! \<C-]>"
+  call assert_equal(2, line('.'))
+  bw
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index d82060838..30a62c144 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1357,
 /**/
     1356,
 /**/

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1uAW5w-001iDY-ON%40256bit.org.

Raspunde prin e-mail lui