Better way to check for terminal buffer
This commit is contained in:
parent
d54613d2dd
commit
0c307d5f73
|
@ -149,22 +149,20 @@ function! airline#check_mode(winnr)
|
|||
let s:airline_run += 1
|
||||
|
||||
let context = s:contexts[a:winnr]
|
||||
let is_term = 0
|
||||
if exists("*term_list")
|
||||
let is_term = index(term_list(), bufnr('')) > -1
|
||||
endif
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode()
|
||||
if exists("*term_list") && index(term_list(), bufnr('')) > -1
|
||||
let l:m = "t"
|
||||
endif
|
||||
if l:m ==# "i"
|
||||
let l:mode = ['insert']
|
||||
elseif l:m ==# "R"
|
||||
let l:mode = ['replace']
|
||||
elseif l:m =~# '\v(v|V||s|S|)'
|
||||
let l:mode = ['visual']
|
||||
elseif l:m ==# "t" || is_term
|
||||
elseif l:m ==# "t"
|
||||
let l:mode = ['terminal']
|
||||
let l:m = 't'
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue