mirror of
https://github.com/lilydjwg/fcitx.vim.git
synced 2025-12-26 09:54:57 +08:00
add another function FcitxCurrentIMwithRime to show RIME info too
see https://github.com/lilydjwg/fcitx.vim/issues/33#issuecomment-2002346047
This commit is contained in:
parent
451d277bbd
commit
28d5bcc86d
2 changed files with 14 additions and 0 deletions
|
|
@ -26,6 +26,13 @@ class FcitxComm:
|
|||
else:
|
||||
return im
|
||||
|
||||
def current_and_rime(self):
|
||||
im = self.fcitx.CurrentInputMethod()
|
||||
if im == 'rime':
|
||||
return 'rime:' + self._get_rime().GetCurrentSchema()
|
||||
else:
|
||||
return im
|
||||
|
||||
def _get_rime(self):
|
||||
if self._rime is None:
|
||||
obj = self.bus.get_object('org.fcitx.Fcitx5', '/rime')
|
||||
|
|
@ -90,3 +97,7 @@ def fcitx2zh():
|
|||
@may_reconnect
|
||||
def fcitx_current_im():
|
||||
return Fcitx.current()
|
||||
|
||||
@may_reconnect
|
||||
def fcitx_current_im_and_rime():
|
||||
return Fcitx.current_and_rime()
|
||||
|
|
|
|||
|
|
@ -51,6 +51,9 @@ elseif has('python3')
|
|||
function FcitxCurrentIM()
|
||||
return py3eval('fcitx_current_im()')
|
||||
endfunction
|
||||
function FcitxCurrentIMwithRime()
|
||||
return py3eval('fcitx_current_im_and_rime()')
|
||||
endfunction
|
||||
|
||||
let g:loaded_fcitx = 1
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue