From ff0f9a45a5d81d2c8aa67601c264b18c4fe26b15 Mon Sep 17 00:00:00 2001 From: wzy <32936898+Freed-Wu@users.noreply.github.com> Date: Thu, 25 Apr 2024 05:11:48 +0800 Subject: [PATCH] xkblayout: use FcitxCurrentIMwithRime() when available (#2670) latest version of fcitx.vim add FcitxCurrentIMwithRime() to display input method information in detail --- autoload/airline/extensions/xkblayout.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/xkblayout.vim b/autoload/airline/extensions/xkblayout.vim index 7e774a2e..1fd11670 100644 --- a/autoload/airline/extensions/xkblayout.vim +++ b/autoload/airline/extensions/xkblayout.vim @@ -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'})