Skip to content

Commit daacd02

Browse files
committed
Add a workaround for Neovim #23036.
1 parent 6580cf5 commit daacd02

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

autoload/startuptime.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ function! s:Profile(onfinish, onprogress, options, tries, file, items) abort
265265
call delete(a:file)
266266
endif
267267
if a:tries ==# 0
268+
if has('nvim-0.9') && a:options.tries * 2 ==# len(a:items)
269+
" Add a workaround for Neovim #23036. When the number of results is double
270+
" what's expected, use every other result.
271+
let l:items = []
272+
for l:idx in range(0, len(a:items) - 1, 2)
273+
call add(l:items, a:items[l:idx])
274+
endfor
275+
call remove(a:items, 0, -1)
276+
call extend(a:items, l:items)
277+
endif
268278
call a:onfinish()
269279
return
270280
endif

0 commit comments

Comments
 (0)