Prevent calling autoload on entering Insert mode.

This commit is contained in:
Israel Chauca Fuentes
2010-08-14 15:28:15 -05:00
parent a678d7baab
commit 90cb449ada
2 changed files with 11 additions and 3 deletions

View File

@@ -8,6 +8,8 @@
" Utilities {{{ " Utilities {{{
let delimitMate_loaded = 1
function! delimitMate#ShouldJump() "{{{ function! delimitMate#ShouldJump() "{{{
" Returns 1 if the next character is a closing delimiter. " Returns 1 if the next character is a closing delimiter.
let col = col('.') let col = col('.')

View File

@@ -268,6 +268,12 @@ function! s:DelimitMateSwitch() "{{{
endif endif
endfunction "}}} endfunction "}}}
function! s:FlushBuffer()
if exists('g:delimitMate_loaded')
call delimitMate#FlushBuffer()
endif
endfunction
"}}} "}}}
" Mappers: {{{ " Mappers: {{{
@@ -409,10 +415,10 @@ augroup delimitMate
\ endif \ endif
" Flush the char buffer: " Flush the char buffer:
autocmd InsertEnter * call delimitMate#FlushBuffer() autocmd InsertEnter * call <SID>FlushBuffer()
autocmd BufEnter * autocmd BufEnter *
\ if mode() == 'i' | \ if mode() == 'i' |
\ call delimitMate#FlushBuffer() | \ call <SID>FlushBuffer() |
\ endif \ endif
augroup END augroup END