mode: add support for virt replace mode

fixes #1792
This commit is contained in:
Christian Brabandt 2018-09-16 18:25:27 +02:00
parent aec0a1a15a
commit bcd37fc115
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 8 additions and 5 deletions

View File

@ -147,16 +147,18 @@ function! airline#check_mode(winnr)
let context = s:contexts[a:winnr] let context = s:contexts[a:winnr]
if get(w:, 'airline_active', 1) if get(w:, 'airline_active', 1)
let l:m = mode() let l:m = mode(1)
if l:m ==# "i" if l:m[0] ==# "i"
let l:mode = ['insert'] let l:mode = ['insert']
elseif l:m ==# "R" elseif l:m ==# "Rv"
let l:mode =['virtual replace']
elseif l:m[0] ==# "R"
let l:mode = ['replace'] let l:mode = ['replace']
elseif l:m =~# '\v(v|V||s|S|)' elseif l:m[0] =~# '\v(v|V||s|S|)'
let l:mode = ['visual'] let l:mode = ['visual']
elseif l:m ==# "t" elseif l:m ==# "t"
let l:mode = ['terminal'] let l:mode = ['terminal']
elseif l:m ==# "c" elseif l:m[0] ==# "c"
let l:mode = ['commandline'] let l:mode = ['commandline']
else else
let l:mode = ['normal'] let l:mode = ['normal']

View File

@ -47,6 +47,7 @@ function! airline#init#bootstrap()
\ 'S' : 'S-LINE', \ 'S' : 'S-LINE',
\ '' : 'S-BLOCK', \ '' : 'S-BLOCK',
\ 't' : 'TERMINAL', \ 't' : 'TERMINAL',
\ 'Rv' : 'V REPLACE',
\ }, 'keep') \ }, 'keep')
call s:check_defined('g:airline_theme_map', {}) call s:check_defined('g:airline_theme_map', {})