From: Jon Parise Date: Sun, 21 Sep 2025 17:51:00 +0000 (+0000) Subject: runtime(vimgoto): recognize 'silent' prefixes X-Git-Tag: v9.1.1781~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b973492ae0996a584a56b2513b3b6aa29f27459;p=thirdparty%2Fvim.git runtime(vimgoto): recognize 'silent' prefixes It's common to optionally prefix commands like 'packadd!' with 'silent!', but that wasn't recognized by these patterns. This change adds 'silent' support to the 'packadd', 'runtime', and 'colorscheme' command patterns. closes: #18361 Signed-off-by: Jon Parise Signed-off-by: Christian Brabandt --- diff --git a/runtime/autoload/vimgoto.vim b/runtime/autoload/vimgoto.vim index 121af4ef32..421732ce89 100644 --- a/runtime/autoload/vimgoto.vim +++ b/runtime/autoload/vimgoto.vim @@ -4,7 +4,7 @@ vim9script # Contributers: @lacygoill # Shane-XB-Qian # Andrew Radev -# Last Change: 2025 Sep 02 +# Last Change: 2025 Sep 21 # # Vim Script to handle jumping to the targets of several types of Vim commands # (:import, :packadd, :runtime, :colorscheme), and to autoloaded functions of @@ -16,17 +16,17 @@ vim9script export def Find(editcmd: string) #{{{2 var curline: string = getline('.') - if curline =~ '^\s*\%(:\s*\)\=packadd!\=\s' + if curline =~ '^\s*\%(:\s*\)\=\%(sil\%[ent]!\=\s\+\)\=packadd!\=\s' HandlePackaddLine(editcmd, curline) return endif - if curline =~ '^\s*\%(:\s*\)\=ru\%[ntime]!\=' + if curline =~ '^\s*\%(:\s*\)\=\%(sil\%[ent]!\=\s\+\)\=ru\%[ntime]!\=' HandleRuntimeLine(editcmd, curline, expand('')) return endif - if curline =~ '^\s*\%(:\s*\)\=colo\%[rscheme]\s' + if curline =~ '^\s*\%(:\s*\)\=\%(sil\%[ent]!\=\s\+\)\=colo\%[rscheme]\s' HandleColoLine(editcmd, curline) return endif