mirror of
https://github.com/junegunn/vim-plug.git
synced 2026-10-30 08:10:18 +00:00
Skip BufRead for an unnamed empty buffer (#1341)
Loading a plugin on demand triggers BufRead to apply ftdetect and ftplugin files, but there is nothing to detect in an unnamed empty buffer such as the one Vim creates on startup. Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
This commit is contained in:
1 parent
4da42e9a5c
commit
7e5aae5e11
1 file changed
+4
@@ -570,6 +570,10 @@ function! s:doautocmd(...)
|
||||
endfunction
|
||||
|
||||
function! s:dobufread(names)
|
||||
" Nothing to detect in an unnamed empty buffer, e.g. the one on startup
|
||||
if empty(bufname('%')) && line('$') == 1 && empty(getline(1))
|
||||
return
|
||||
endif
|
||||
for name in a:names
|
||||
let path = s:rtp(g:plugs[name])
|
||||
for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin']
|
||||
|
||||
Reference in new issue
Block a user