From bcd37fc1152912fd456606152cebc8d5fc8db865 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 16 Sep 2018 18:25:27 +0200 Subject: [PATCH] mode: add support for virt replace mode fixes #1792 --- autoload/airline.vim | 12 +++++++----- autoload/airline/init.vim | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index b9181ffd..d9d47f69 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -147,16 +147,18 @@ function! airline#check_mode(winnr) let context = s:contexts[a:winnr] if get(w:, 'airline_active', 1) - let l:m = mode() - if l:m ==# "i" + let l:m = mode(1) + if l:m[0] ==# "i" 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'] - elseif l:m =~# '\v(v|V||s|S|)' + elseif l:m[0] =~# '\v(v|V||s|S|)' let l:mode = ['visual'] elseif l:m ==# "t" let l:mode = ['terminal'] - elseif l:m ==# "c" + elseif l:m[0] ==# "c" let l:mode = ['commandline'] else let l:mode = ['normal'] diff --git a/autoload/airline/init.vim b/autoload/airline/init.vim index 278d3aec..e860258b 100644 --- a/autoload/airline/init.vim +++ b/autoload/airline/init.vim @@ -47,6 +47,7 @@ function! airline#init#bootstrap() \ 'S' : 'S-LINE', \ '' : 'S-BLOCK', \ 't' : 'TERMINAL', + \ 'Rv' : 'V REPLACE', \ }, 'keep') call s:check_defined('g:airline_theme_map', {})