Skip to content

Commit

Permalink
Fix L2U autocmds when switching buffers
Browse files Browse the repository at this point in the history
fix #44
  • Loading branch information
carlobaldassi committed Feb 22, 2015
1 parent 5443e81 commit e330617
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions autoload/LaTeXtoUnicode.vim
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function! LaTeXtoUnicode#Enable()
let b:prev_omnifunc = &omnifunc
endif

set omnifunc=LaTeXtoUnicode#ommnifunc
setlocal omnifunc=LaTeXtoUnicode#ommnifunc

let b:l2u_enabled = 1

Expand Down Expand Up @@ -462,7 +462,7 @@ function! s:L2U_SetTab(wait_vim_enter)
cnoremap <buffer> <Plug>L2UCmdTab <C-\>eLaTeXtoUnicode#CmdTab()<CR>
augroup L2UTab
autocmd!
autocmd! * <buffer>
" Every time a completion finishes, the fallback may be invoked
autocmd CompleteDone <buffer> call LaTeXtoUnicode#FallbackCallback()
augroup END
Expand All @@ -481,8 +481,9 @@ function! s:L2U_UnsetTab()
endif
iunmap <buffer> <Plug>L2UTab
exe 'iunmap <buffer> ' . s:l2u_fallback_trigger
autocmd! L2UTab
augroup! L2UTab
augroup L2UTab
autocmd! * <buffer>
augroup END
let b:l2u_tab_set = 0
endfunction

Expand Down Expand Up @@ -539,7 +540,7 @@ function! s:L2U_SetAutoSub(wait_vim_enter)
inoremap <buffer><expr> <Plug>L2UAutoSub LaTeXtoUnicode#AutoSub("\n", "\<CR>")
augroup L2UAutoSub
autocmd!
autocmd! * <buffer>
autocmd InsertCharPre <buffer> call LaTeXtoUnicode#AutoSub()
augroup END

Expand All @@ -554,8 +555,9 @@ function! s:L2U_UnsetAutoSub()

iunmap <buffer> <CR>
iunmap <buffer> <Plug>L2UAutoSub
autocmd! L2UAutoSub
augroup! L2UAutoSub
augroup L2UAutoSub
autocmd! * <buffer>
augroup END
let b:l2u_autosub_set = 0
endfunction

Expand Down

0 comments on commit e330617

Please sign in to comment.