File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ endfunction
179179function ! s: SetFile () abort
180180 let l: isfname = &isfname
181181 " On Windows, to escape '[' with a backslash below, the character has to be
182- " removed from 'isfname' (see ' :help wilcard' ).
182+ " removed from 'isfname' (:help wilcard).
183183 set isfname -= [
184184 let l: n = 0
185185 while 1
@@ -188,9 +188,13 @@ function! s:SetFile() abort
188188 if l: n ># 0
189189 let l: text .= ' .' . l: n
190190 endif
191- " Prepend backslash to avoid the special wildcard meaning (see ':help
192- " wildcard'). Issue #9.
193- execute ' silent file \[' . l: text . ' ]'
191+ " Prepend backslash to the prefix to avoid the special wildcard meaning
192+ " (:help wildcard). Two backslashes are necessary on Windows, since Vim
193+ " removes backslashes before special characters (:help dos-backslash).
194+ " Issue #9.
195+ let l: prefix = has (' win32' ) ? ' \\[' : ' \['
196+ let l: suffix = ' ]'
197+ execute ' silent file ' . l: prefix . l: text . l: suffix
194198 catch
195199 let l: n += 1
196200 continue
You can’t perform that action at this time.
0 commit comments