Mercurial > vim
comparison src/buffer.c @ 12572:31737ff54115 v8.0.1164
patch 8.0.1164: changing StatusLine highlight does not always work
commit https://github.com/vim/vim/commit/65ed136844fbaffdd473903ed841c944600234dc
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 30 16:00:14 2017 +0200
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 #2171, closes #2120)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 30 Sep 2017 16:15:04 +0200 |
parents | 65c7769ef6d1 |
children | 560adb3eed8b |
comparison
equal
deleted
inserted
replaced
12571:b514b5992d41 | 12572:31737ff54115 |
---|---|
3908 char_u tmp[TMPLEN]; | 3908 char_u tmp[TMPLEN]; |
3909 char_u *usefmt = fmt; | 3909 char_u *usefmt = fmt; |
3910 struct stl_hlrec *sp; | 3910 struct stl_hlrec *sp; |
3911 int save_must_redraw = must_redraw; | 3911 int save_must_redraw = must_redraw; |
3912 int save_redr_type = curwin->w_redr_type; | 3912 int save_redr_type = curwin->w_redr_type; |
3913 int save_highlight_shcnaged = need_highlight_changed; | |
3914 | 3913 |
3915 #ifdef FEAT_EVAL | 3914 #ifdef FEAT_EVAL |
3916 /* | 3915 /* |
3917 * When the format starts with "%!" then evaluate it as an expression and | 3916 * When the format starts with "%!" then evaluate it as an expression and |
3918 * use the result as the actual format string. | 3917 * use the result as the actual format string. |
4681 } | 4680 } |
4682 sp->start = NULL; | 4681 sp->start = NULL; |
4683 sp->userhl = 0; | 4682 sp->userhl = 0; |
4684 } | 4683 } |
4685 | 4684 |
4686 /* We do not want redrawing a stausline, ruler, title, etc. to trigger | 4685 /* When inside update_screen we do not want redrawing a stausline, ruler, |
4687 * another redraw, it may cause an endless loop. This happens when a | 4686 * title, etc. to trigger another redraw, it may cause an endless loop. */ |
4688 * statusline changes a highlight group. */ | 4687 if (updating_screen) |
4689 must_redraw = save_must_redraw; | 4688 { |
4690 curwin->w_redr_type = save_redr_type; | 4689 must_redraw = save_must_redraw; |
4691 need_highlight_changed = save_highlight_shcnaged; | 4690 curwin->w_redr_type = save_redr_type; |
4691 } | |
4692 | 4692 |
4693 return width; | 4693 return width; |
4694 } | 4694 } |
4695 #endif /* FEAT_STL_OPT */ | 4695 #endif /* FEAT_STL_OPT */ |
4696 | 4696 |