Skip to content

Commit

Permalink
An additional backslash is needed on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Dec 4, 2021
1 parent e49fc5d commit 95b4070
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions autoload/startuptime.vim
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ endfunction
function! s:SetFile() abort
let l:isfname = &isfname
" On Windows, to escape '[' with a backslash below, the character has to be
" removed from 'isfname' (see ':help wilcard').
" removed from 'isfname' (:help wilcard).
set isfname-=[
let l:n = 0
while 1
Expand All @@ -188,9 +188,13 @@ function! s:SetFile() abort
if l:n ># 0
let l:text .= '.' . l:n
endif
" Prepend backslash to avoid the special wildcard meaning (see ':help
" wildcard'). Issue #9.
execute 'silent file \[' . l:text . ']'
" Prepend backslash to the prefix to avoid the special wildcard meaning
" (:help wildcard). Two backslashes are necessary on Windows, since Vim
" removes backslashes before special characters (:help dos-backslash).
" Issue #9.
let l:prefix = has('win32') ? '\\[' : '\['
let l:suffix = ']'
execute 'silent file ' . l:prefix . l:text . l:suffix
catch
let l:n += 1
continue
Expand Down

0 comments on commit 95b4070

Please sign in to comment.