From 0f5eedff74973d0b11fa4b61b0cba5567b63381c Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 26 Aug 2020 22:42:57 +0200 Subject: [PATCH] mode: keep hi setting when switching from 'n' to 'ni' when using `Ctrl-O` from insert mode, the highlighting currently updates from insert mode highlighting to normal mode highlighting. Unfortunately, changing the highlighting can be a bit expansive, so redefining the highlighting just for one simple command does not make too much sense. Instead, keep the insert mode highlighting, because that's kind of like the major mode Vim is in currently. The mode message uses '(INSERT)' to distinguish between a "normal" INSERT mode and this temporary INSERT mode, so it should still be visually be distinguishable. closes #2217 --- autoload/airline.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/airline.vim b/autoload/airline.vim index f2e20168..77e81bd4 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -221,7 +221,7 @@ function! airline#check_mode(winnr) 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:mode = ['insert'] let l:m = 'ni' else let l:mode = ['normal']