diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-06-28 20:50:04 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-07-06 09:34:00 -0400 |
commit | 8c8961d9a28ad9c79dc8de09801d975b8a450257 (patch) | |
tree | 68ff37f6add89cf7dfc968c37d466c2993f94293 /src/nvim/buffer.c | |
parent | 6012e4a52c298bf2ced3dbadd8e43dc0f1db79ad (diff) | |
download | rneovim-8c8961d9a28ad9c79dc8de09801d975b8a450257.tar.gz rneovim-8c8961d9a28ad9c79dc8de09801d975b8a450257.tar.bz2 rneovim-8c8961d9a28ad9c79dc8de09801d975b8a450257.zip |
vim-patch:8.0.1164: changing StatusLine highlight does not always work
Problem: Changing StatusLine highlight while evaluating 'statusline' may
not change the status line color.
Solution: When changing highlighting while redrawing don't cause another
redraw. (suggested by Ozaki Kiichi, closes vim/vim#2171, closes vim/vim#2120)
https://github.com/vim/vim/commit/65ed136844fbaffdd473903ed841c944600234dc
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 5678f518f5..d9ed9c6861 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3361,7 +3361,6 @@ int build_stl_str_hl( char_u *usefmt = fmt; const int save_must_redraw = must_redraw; const int save_redr_type = curwin->w_redr_type; - const int save_highlight_shcnaged = need_highlight_changed; // When the format starts with "%!" then evaluate it as an expression and // use the result as the actual format string. @@ -4425,12 +4424,12 @@ int build_stl_str_hl( cur_tab_rec->def.func = NULL; } - // We do not want redrawing a stausline, ruler, title, etc. to trigger - // another redraw, it may cause an endless loop. This happens when a - // statusline changes a highlight group. - must_redraw = save_must_redraw; - curwin->w_redr_type = save_redr_type; - need_highlight_changed = save_highlight_shcnaged; + // When inside update_screen we do not want redrawing a stausline, ruler, + // title, etc. to trigger another redraw, it may cause an endless loop. + if (updating_screen) { + must_redraw = save_must_redraw; + curwin->w_redr_type = save_redr_type; + } return width; } |