main: support for Vims terminal mode
Currently this is a hack, to get terminal mode from Vim. However there is no better solution yet, since the API is not stable here. Until then, just use the hack with index(term_list(), bufnr('')) > -1
This commit is contained in:
parent
72e5f04f7c
commit
846d85aaa1
|
@ -149,6 +149,10 @@ function! airline#check_mode(winnr)
|
|||
let s:airline_run += 1
|
||||
|
||||
let context = s:contexts[a:winnr]
|
||||
let is_term = 0
|
||||
if has("terminal")
|
||||
let is_term = index(term_list(), bufnr('')) > -1
|
||||
endif
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode()
|
||||
|
@ -158,8 +162,9 @@ function! airline#check_mode(winnr)
|
|||
let l:mode = ['replace']
|
||||
elseif l:m =~# '\v(v|V||s|S|)'
|
||||
let l:mode = ['visual']
|
||||
elseif l:m ==# "t"
|
||||
elseif l:m ==# "t" || is_term
|
||||
let l:mode = ['terminal']
|
||||
let l:m = 't'
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue