Skip to content

Commit

Permalink
xkblayout: use FcitxCurrentIMwithRime() when available (#2670)
Browse files Browse the repository at this point in the history
latest version of fcitx.vim add FcitxCurrentIMwithRime()
to display input method information in detail
  • Loading branch information
Freed-Wu committed Apr 24, 2024
1 parent d9f42cb commit ff0f9a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion autoload/airline/extensions/xkblayout.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
Expand Down

0 comments on commit ff0f9a4

Please sign in to comment.