mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-26 10:13:42 +08:00
main: detect some more modes
This commit is contained in:
parent
326b37cf13
commit
fce8585239
|
@ -148,7 +148,9 @@ function! airline#check_mode(winnr)
|
|||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode(1)
|
||||
if l:m[0] ==# "i"
|
||||
if l:m ==# "i"
|
||||
let l:mode = ['insert']
|
||||
elseif l:m[0] ==# "i"
|
||||
let l:mode = ['insert']
|
||||
elseif l:m ==# "Rv"
|
||||
let l:mode =['replace']
|
||||
|
@ -160,10 +162,15 @@ function! airline#check_mode(winnr)
|
|||
let l:mode = ['terminal']
|
||||
elseif l:m[0] ==# "c"
|
||||
let l:mode = ['commandline']
|
||||
elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode
|
||||
let l:mode = ['normal']
|
||||
elseif l:m[0:1] ==# 'ni'
|
||||
let l:mode = ['normal']
|
||||
let l:m = 'ni'
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
if l:m !=# 'Rv'
|
||||
if index(['Rv', 'no', 'ni', 'ix', 'ic'], l:m) == -1
|
||||
let l:m = l:m[0]
|
||||
endif
|
||||
let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
|
||||
|
|
|
@ -36,8 +36,12 @@ function! airline#init#bootstrap()
|
|||
call s:check_defined('g:airline_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
\ '__' : '------',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'ic' : 'INSERT COMPL',
|
||||
\ 'ix' : 'INSERT COMPL',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'ni' : '(INSERT)',
|
||||
\ 'no' : 'OP PENDING',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
|
|
Loading…
Reference in New Issue
Block a user