Do not run fcitx5-remote in a shell

This commit is contained in:
zeertzjq 2021-09-20 20:40:44 +08:00
parent 3554b279a0
commit 67a73dda4f

View file

@ -11,19 +11,19 @@ endif
let s:keepcpo = &cpo
set cpo&vim
" If g:fcitx5_remote is set (to the path to `fcitx5-remove`), use it to toggle IME state.
" If g:fcitx5_remote is set (to the path to `fcitx5-remote`), use it to toggle IME state.
if exists("g:fcitx5_remote")
function Fcitx2en()
let inputstatus = trim(system(g:fcitx5_remote))
let inputstatus = trim(system([g:fcitx5_remote]))
if inputstatus == '2'
let b:inputtoggle = 1
call system(g:fcitx5_remote . ' -c')
call system([g:fcitx5_remote, '-c'])
endif
endfunction
function Fcitx2zh()
try
if b:inputtoggle == 1
call system(g:fcitx5_remote . ' -o')
call system([g:fcitx5_remote, '-o'])
let b:inputtoggle = 0
endif
catch /inputtoggle/