From 6e53d15569a1226f654eb61cd005ea5e8f751d89 Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Mon, 8 Feb 2021 14:29:37 +0800 Subject: [PATCH] support for earlier Vim that doesn't have InsertLeavePre --- plugin/fcitx.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/fcitx.vim b/plugin/fcitx.vim index 779ba13..e63e5cb 100644 --- a/plugin/fcitx.vim +++ b/plugin/fcitx.vim @@ -15,7 +15,11 @@ let g:loaded_fcitx = 1 try " abort on fail exe 'py3file' expand(':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