From 91900b9a5cd3b6a933a868f4d0db3c8c01fa272f Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 30 Mar 2026 10:15:19 +0000 Subject: [PATCH] runtime(vimgoto): Not correctly escaping the filanems MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: runtime(vimgoto): not correctly escaping the filenames Solution: Use fnamescape() (MichaƂ Majchrowicz) Signed-off-by: Christian Brabandt --- runtime/autoload/vimgoto.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/autoload/vimgoto.vim b/runtime/autoload/vimgoto.vim index 32756e07df..634457dff5 100644 --- a/runtime/autoload/vimgoto.vim +++ b/runtime/autoload/vimgoto.vim @@ -5,7 +5,7 @@ vim9script # Shane-XB-Qian # Andrew Radev # thinca -# Last Change: 2026 Feb 10 +# Last Change: 2026 Mar 30 # # Vim script to handle jumping to the targets of several types of Vim commands # (:import, :packadd, :runtime, :colorscheme), and to autoloaded functions of @@ -168,7 +168,7 @@ def HandleImportLine(editcmd: string, curline: string) #{{{2 "\F": 'split', "\gF": 'tab split', }[editcmd] - execute how_to_split .. ' ' .. filepath + execute how_to_split .. ' ' .. fnameescape(filepath) enddef def Open(target: any, editcmd: string, search_pattern: string = '') #{{{2 @@ -193,7 +193,7 @@ def Open(target: any, editcmd: string, search_pattern: string = '') #{{{2 cmd = $'+silent\ call\ search(''{escaped_pattern}'')' endif - execute $'{split} {cmd} {fname}' + execute $'{split} {cmd} {fnameescape(fname)}' # If there are several files to open, put them into an arglist. if target->typename() == 'list'