mirror of
https://github.com/lilydjwg/fcitx.vim.git
synced 2026-05-15 01:51:13 +08:00
better error handling
This commit is contained in:
parent
056f8c580d
commit
d619809504
2 changed files with 9 additions and 4 deletions
|
|
@ -18,7 +18,10 @@ class FcitxComm():
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
self.fcitx.Deactivate()
|
self.fcitx.Deactivate()
|
||||||
|
|
||||||
Fcitx = FcitxComm()
|
try:
|
||||||
|
Fcitx = FcitxComm()
|
||||||
|
except dbus.exceptions.DBusException as e:
|
||||||
|
vim.command('echohl WarningMsg | echom "fcitx.vim not loaded: %s" | echohl NONE' % e)
|
||||||
|
|
||||||
def may_reconnect(func):
|
def may_reconnect(func):
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,11 @@ let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
let g:loaded_fcitx = 1
|
let g:loaded_fcitx = 1
|
||||||
|
|
||||||
exe 'py3file' expand('<sfile>:r') . '.py'
|
try " abort on fail
|
||||||
au InsertLeave * py3 fcitx2en()
|
exe 'py3file' expand('<sfile>:r') . '.py'
|
||||||
au InsertEnter * py3 fcitx2zh()
|
au InsertLeave * py3 fcitx2en()
|
||||||
|
au InsertEnter * py3 fcitx2zh()
|
||||||
|
endtry
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Restoration And Modelines:
|
" Restoration And Modelines:
|
||||||
let &cpo=s:keepcpo
|
let &cpo=s:keepcpo
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue