Skip to content

Commit

Permalink
Make sure that the buffer didn't change.
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Jan 10, 2021
1 parent 37ccabf commit c2ab5b4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions autoload/startuptime.vim
Original file line number Diff line number Diff line change
Expand Up @@ -797,13 +797,16 @@ function! startuptime#StartupTime(mods, ...)
call s:SetFile()
call append(line('$') - 1, 'vim-startuptime: running... (please wait)')
let l:file = tempname()
let l:args = [l:file, win_getid(), bufnr('%'), l:options]
let l:bufnr = bufnr('%')
let l:args = [l:file, win_getid(), l:bufnr, l:options]
let l:Callback = function('startuptime#Main', l:args)
try
call s:Profile(l:Callback, l:options.tries, l:file)
catch
call s:ClearCurrentBuffer()
call append(line('$') - 1, 'vim-startuptime: error')
call append(line('$') - 1, v:exception)
if bufnr('%') ==# l:bufnr
call s:ClearCurrentBuffer()
call append(line('$') - 1, 'vim-startuptime: error')
call append(line('$') - 1, v:exception)
endif
endtry
endfunction

0 comments on commit c2ab5b4

Please sign in to comment.