xkblayout: use FcitxCurrentIMwithRime() when available (#2670)
latest version of fcitx.vim add FcitxCurrentIMwithRime() to display input method information in detail
This commit is contained in:
parent
d9f42cb467
commit
ff0f9a45a5
|
@ -12,8 +12,13 @@ function! airline#extensions#xkblayout#status()
|
|||
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
|
||||
let keyboard_layout = get(split(keyboard_layout, '\.'), -1, '')
|
||||
else
|
||||
if exists('*FcitxCurrentIMwithRime')
|
||||
let keyboard_layout = FcitxCurrentIMwithRime()
|
||||
else
|
||||
let keyboard_layout = FcitxCurrentIM()
|
||||
endif
|
||||
" substitute keyboard-us to us
|
||||
let keyboard_layout = substitute(FcitxCurrentIM(), 'keyboard-', '', 'g')
|
||||
let keyboard_layout = substitute(keyboard_layout, 'keyboard-', '', 'g')
|
||||
endif
|
||||
|
||||
let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
|
||||
|
|
Loading…
Reference in New Issue