Skip to content

Commit

Permalink
Move prefix and suffix out of loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Dec 4, 2021
1 parent 95b4070 commit 89c81d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions autoload/startuptime.vim
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,19 @@ function! s:SetFile() abort
" On Windows, to escape '[' with a backslash below, the character has to be
" removed from 'isfname' (:help wilcard).
set isfname-=[
" 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 = ']'
let l:n = 0
while 1
try
let l:text = 'startuptime'
if l:n ># 0
let l:text .= '.' . l:n
endif
" 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
Expand Down

0 comments on commit 89c81d1

Please sign in to comment.