Fix #474 - Load ftdetect files in filetypedetect augroup

This commit is contained in:
Junegunn Choi 2016-04-17 01:13:13 +09:00
parent 92bcecddd6
commit 0d9efb01c7
3 changed files with 19 additions and 0 deletions

View file

@ -222,7 +222,9 @@ function! plug#end()
if has_key(plug, 'for') if has_key(plug, 'for')
let types = s:to_a(plug.for) let types = s:to_a(plug.for)
if !empty(types) if !empty(types)
augroup filetypedetect
call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim')
augroup END
endif endif
for type in types for type in types
call s:assoc(lod.ft, type, name) call s:assoc(lod.ft, type, name)

View file

@ -286,3 +286,19 @@ Execute (#350: Ruby installer failed to unshallow tagged plugin on update):
PlugUpdate PlugUpdate
Assert !filereadable(g:plugs['vim-easy-align'].dir.'/.git/shallow') Assert !filereadable(g:plugs['vim-easy-align'].dir.'/.git/shallow')
q q
**********************************************************************
Execute (#474: Load ftdetect files in filetypedetect augroup):
call plug#begin('/tmp/plugged')
Plug 'junegunn/rust.vim', { 'for': 'rust', 'commit': '115d321d383eb96d438466c56cc871fcc1bd0faa' }
call plug#end()
PlugInstall
q
tabnew /tmp/any.rs
AssertEqual 'rust', &filetype
Log &filetype
filetype detect
AssertEqual 'rust', &filetype
Log &filetype
bd

View file

@ -27,6 +27,7 @@ clone_repos() (
done done
clone https://github.com/vim-scripts/beauty256.git vim-scripts/beauty256 & clone https://github.com/vim-scripts/beauty256.git vim-scripts/beauty256 &
clone https://github.com/junegunn/fzf.git fzf & clone https://github.com/junegunn/fzf.git fzf &
clone https://github.com/rust-lang/rust.vim.git junegunn/rust.vim &
clone https://github.com/yous/subsubmodule.git yous/subsubmodule && \ clone https://github.com/yous/subsubmodule.git yous/subsubmodule && \
(cd yous/subsubmodule && git submodule update --init --recursive &) & (cd yous/subsubmodule && git submodule update --init --recursive &) &
wait wait