Skip to content

Commit 91900b9

Browse files
committed
runtime(vimgoto): Not correctly escaping the filanems
Problem: runtime(vimgoto): not correctly escaping the filenames Solution: Use fnamescape() (Michał Majchrowicz) Signed-off-by: Christian Brabandt <[email protected]>
1 parent aa5c931 commit 91900b9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

runtime/autoload/vimgoto.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ vim9script
55
# Shane-XB-Qian
66
# Andrew Radev
77
# thinca
8-
# Last Change: 2026 Feb 10
8+
# Last Change: 2026 Mar 30
99
#
1010
# Vim script to handle jumping to the targets of several types of Vim commands
1111
# (:import, :packadd, :runtime, :colorscheme), and to autoloaded functions of
@@ -168,7 +168,7 @@ def HandleImportLine(editcmd: string, curline: string) #{{{2
168168
"\<C-W>F": 'split',
169169
"\<C-W>gF": 'tab split',
170170
}[editcmd]
171-
execute how_to_split .. ' ' .. filepath
171+
execute how_to_split .. ' ' .. fnameescape(filepath)
172172
enddef
173173

174174
def Open(target: any, editcmd: string, search_pattern: string = '') #{{{2
@@ -193,7 +193,7 @@ def Open(target: any, editcmd: string, search_pattern: string = '') #{{{2
193193
cmd = $'+silent\ call\ search(''{escaped_pattern}'')'
194194
endif
195195

196-
execute $'{split} {cmd} {fname}'
196+
execute $'{split} {cmd} {fnameescape(fname)}'
197197

198198
# If there are several files to open, put them into an arglist.
199199
if target->typename() == 'list<string>'

0 commit comments

Comments
 (0)