support for earlier Vim that doesn't have InsertLeavePre

This commit is contained in:
lilydjwg 2021-02-08 14:29:37 +08:00
parent 1efd21b9aa
commit c038116610

View file

@ -15,7 +15,11 @@ let g:loaded_fcitx = 1
try " abort on fail
exe 'py3file' expand('<sfile>:r') . '.py'
if py3eval('fcitx_loaded')
au InsertLeavePre * py3 fcitx2en()
if exists('##InsertLeavePre')
au InsertLeavePre * py3 fcitx2en()
else
au InsertLeave * py3 fcitx2en()
endif
au InsertEnter * py3 fcitx2zh()
endif
endtry