Commit: runtime(vimgoto): recognize 'silent' prefixes

3 views
Skip to first unread message

Christian Brabandt

unread,
Sep 21, 2025, 2:00:15 PM (6 days ago) Sep 21
to vim...@googlegroups.com
runtime(vimgoto): recognize 'silent' prefixes

Commit: https://github.com/vim/vim/commit/7b973492ae0996a584a56b2513b3b6aa29f27459
Author: Jon Parise <j...@indelible.org>
Date: Sun Sep 21 17:51:00 2025 +0000

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 <j...@indelible.org>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/autoload/vimgoto.vim b/runtime/autoload/vimgoto.vim
index 121af4ef3..421732ce8 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('<cfile>'))
return
endif

- if curline =~ '^\s*\%(:\s*\)\=colo\%[rscheme]\s'
+ if curline =~ '^\s*\%(:\s*\)\=\%(sil\%[ent]!\=\s\+\)\=colo\%[rscheme]\s'
HandleColoLine(editcmd, curline)
return
endif
Reply all
Reply to author
Forward
0 new messages