Fix autopairs isn':t loaded when open new tab by mouse.

This commit is contained in:
jiangfriend@gmail.com 2011-11-13 16:39:45 +08:00
parent 3b74bdd5bf
commit c6d9506de8

View File

@ -170,6 +170,7 @@ function! AutoPairsReturn()
endfunction
function! AutoPairsInit()
let b:autopairs_loaded = 1
let b:autopairs_enabled = 1
for [open, close] in items(g:AutoPairs)
call AutoPairsMap(open)
@ -198,4 +199,12 @@ function! AutoPairsInit()
end
endfunction
au BufRead,BufNewFile,BufCreate,VimEnter * :call AutoPairsInit()
function! AutoPairsForceInit()
if exists('b:autopairs_loaded')
return
else
call AutoPairsInit()
endif
endfunction
au BufEnter * :call AutoPairsForceInit()