dstein64 / vim-startuptime

A plugin for profiling Vim and Neovim startup time.
MIT License
585 stars 11 forks source link

run :StartupTime block nvim if folder have a file `s` #9

Closed fcying closed 2 years ago

fcying commented 2 years ago

nvim 0.6 debian 11

reproduce

nvim -u test_vimrc
:StartupTime
:StartupTime
:StartupTime

work fine.

touch s
nvim -u test_vimrc
:StartupTime
:StartupTime
nvim block, need kill nvim

test_vimrc

let g:config_dir = '/tmp/vimtest'
let g:cache_dir = '/tmp/vimtest/.cache'

let s:plug_install_dir = g:config_dir . '/plugged'
let s:plug_manager_file = s:plug_install_dir . '/vim-plug/plug.vim'
let s:plug_manager_download =
      \ 'silent !git clone --depth 1 https://github.com/junegunn/vim-plug '
      \ . s:plug_install_dir . '/vim-plug'
if filereadable(expand(s:plug_manager_file)) == 0
    exec s:plug_manager_download
endif
exec 'source '. s:plug_install_dir . '/vim-plug/plug.vim'
call plug#begin(expand(s:plug_install_dir))
Plug 'dstein64/vim-startuptime'
call plug#end()
delc PlugUpgrade

filetype plugin indent on
syntax enable

autocmd VimEnter *
      \  if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
      \|   PlugUpdate --sync
      \| endif
dstein64 commented 2 years ago

Thanks for reporting the issue @fcying!

The buffer was named [startuptime] with the Vim command :file [startuptime].

This was causing wildcard expansion that matched when there was a file in the current directory with name s, t, a, r, u, p, i, m, or e (see :help wildcard).

This ultimately led to an infinite loop.

The issue is fixed in v3.1.1.