6 Commits
0.3.2 ... 0.3.3

Author SHA1 Message Date
Junegunn Choi
6ddee62977 Ensure ftplugin files are loaded (#24) 2014-06-22 13:09:18 +09:00
Junegunn Choi
8cf5fca9ca Revert "Ensure ftplugin files are loaded (#24)"
This reverts commit a026eb39c4.

Conflicts:
	plug.vim
2014-06-22 12:49:22 +09:00
Junegunn Choi
347fccb030 Revert "Remove FileType autocmd after loaded"
This reverts commit db3f5ad5c3.

Conflicts:
	plug.vim
2014-06-22 12:45:21 +09:00
Junegunn Choi
a026eb39c4 Ensure ftplugin files are loaded (#24)
If `filetype plugin on` is called before `plug#end()`, filetype
plugin handler is invoked before ODL autocmd from vim-plug which
updates runtimepath and ftplugin files are not loaded.
2014-06-22 10:27:15 +09:00
Junegunn Choi
4d352e1849 Revert "Clear #filetypeplugin for filetype-based ODL (#24)"
This reverts commit 1d477a1a01.
2014-06-22 10:21:58 +09:00
Junegunn Choi
db3f5ad5c3 Remove FileType autocmd after loaded 2014-06-22 09:58:14 +09:00

View File

@@ -58,7 +58,6 @@ set cpo&vim
let s:plug_source = 'https://raw.github.com/junegunn/vim-plug/master/plug.vim'
let s:plug_file = 'Plugfile'
let s:plug_buf = -1
let s:loaded = {}
let s:is_win = has('win32') || has('win64')
let s:me = expand('<sfile>:p')
@@ -123,17 +122,9 @@ function! plug#end()
augroup END
augroup! PlugLOD
endif
let lod = {}
filetype off
if exists('#filetypeplugin') &&
\ !empty(filter(values(g:plugs), 'has_key(v:val, "for")'))
unlet! g:did_load_ftplugin
augroup filetypeplugin
autocmd!
augroup END
augroup! filetypeplugin
endif
" we want to make sure the plugin directories are added to rtp in the same
" order that they are registered with the Plug command. since the s:add_rtp
" function uses ^= to add plugin directories to the front of the rtp, we
@@ -168,12 +159,21 @@ function! plug#end()
for vim in split(globpath(s:rtp(plug), 'ftdetect/**/*.vim'), '\n')
execute 'source '.vim
endfor
augroup PlugLOD
execute printf('autocmd FileType %s call <SID>lod_ft(%s, %s)',
\ join(s:to_a(plug.for), ','), string(name), string(plug))
augroup END
for key in s:to_a(plug.for)
if !has_key(lod, key)
let lod[key] = []
endif
call add(lod[key], name)
endfor
endif
endfor
for [key, names] in items(lod)
augroup PlugLOD
execute printf('autocmd FileType %s call <SID>lod_ft(%s, %s)',
\ key, string(key), string(reverse(names)))
augroup END
endfor
filetype plugin indent on
syntax on
endfunction
@@ -207,12 +207,12 @@ function! s:lod(plug, types)
endfor
endfunction
function! s:lod_ft(name, plug)
if has_key(s:loaded, a:name)
return
endif
call s:lod(a:plug, ['plugin', 'after'])
let s:loaded[a:name] = 1
function! s:lod_ft(pat, names)
for name in a:names
call s:lod(g:plugs[name], ['plugin', 'after'])
endfor
execute 'autocmd! PlugLOD FileType ' . a:pat
let &l:filetype = &l:filetype
endfunction
function! s:lod_cmd(cmd, bang, l1, l2, args, plug)