make it possible to silent the warning on dbus errors

fixes #22.
This commit is contained in:
lilydjwg 2021-05-24 12:42:38 +08:00
parent 4c6ec0e384
commit 92ef27262d

View file

@ -22,7 +22,8 @@ try:
Fcitx = FcitxComm()
fcitx_loaded = True
except dbus.exceptions.DBusException as e:
vim.command('echohl WarningMsg | echom "fcitx.vim not loaded: %s" | echohl NONE' % e)
if not vim.vars.get('silent_unsupported'):
vim.command('echohl WarningMsg | echom "fcitx.vim not loaded: %s" | echohl NONE' % e)
fcitx_loaded = False
def may_reconnect(func):