runtime(vim): Fix for :VimKeywordPrg when syntax does not match

Commit: 
https://github.com/vim/vim/commit/ac5af8ecd3025c2739ab79f6b8529ea0415c1380
Author: Mark Woods <[email protected]>
Date:   Tue Feb 3 14:48:58 2026 +0000

    runtime(vim): Fix for :VimKeywordPrg when syntax does not match
    
    When using vim9-syntax plugin, :VimKeywordPrg does not lookup functions
    correctly, as it relies solely on syntax names to find the help topic.
    
    The syntax keyword used for builtin function is vi9FuncNameBuiltin in
    vim9-syntax plugin, not vimFuncName expected by :VimKeywordPrg, so the
    fallback rules apply, and there is no fallback rule for function calls.
    
    Fix by just checking if the first char after topic is '(', and if so
    assume help topic is a function.
    
    closes: #19320
    
    Signed-off-by: Mark Woods <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index 05aeac4ce..72a87d180 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -12,6 +12,7 @@
 " 2025 Aug 12 by Vim Project (improve vimgoto script #17970))
 " 2025 Aug 16 by Vim Project set com depending on Vim9 or legacy script
 " 2026 Jan 26 by Vim Project set path to common Vim directories #19219
+" 2026 Feb 03 by Vim Project update s:Help to improve detecting functions 
#19320
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin")
@@ -89,7 +90,9 @@ if !exists("*" .. expand("<SID>") .. "Help")
       endif
     endif
 
-    if pre =~# '^\s*:\=$' || pre =~# '\%(\\||\)\@<!|\s*:\=$'
+    if stridx(post, '(') == 0
+      return topic .. '()'
+    elseif pre =~# '^\s*:\=$' || pre =~# '\%(\\||\)\@<!|\s*:\=$'
       return ':' .. topic
     elseif pre =~# '\<v:$'
       return 'v:' .. topic

-- 
-- 
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 visit 
https://groups.google.com/d/msgid/vim_dev/E1vnHsp-00B4sN-Ct%40256bit.org.

Raspunde prin e-mail lui