mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-23 12:41:13 +08:00
Fix bug of keyboard_layout
when `keyboard_layout==''`, `let keyboard_layout = split(keyboard_layout, '\.')[-1]` will return an error.
This commit is contained in:
parent
d0aaa061c2
commit
b96e02c649
|
@ -9,7 +9,7 @@ endif
|
|||
|
||||
function! airline#extensions#xkblayout#status()
|
||||
let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '')
|
||||
let keyboard_layout = split(keyboard_layout, '\.')[-1]
|
||||
let keyboard_layout = get(split(keyboard_layout, '\.'), -1, '')
|
||||
let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'})
|
||||
|
||||
if has_key(short_codes, keyboard_layout)
|
||||
|
|
Loading…
Reference in New Issue
Block a user