Patch 8.0.1073
Problem: May get an endless loop if 'statusline' changes a highlight.
Solution: Do not let evaluating 'statusline' trigger a redraw.
Files: src/buffer.c
*** ../vim-8.0.1072/src/buffer.c 2017-08-29 22:44:33.376176824 +0200
--- src/buffer.c 2017-09-08 13:53:03.248186785 +0200
***************
*** 3915,3922 ****
char_u *t;
int byteval;
#ifdef FEAT_EVAL
! win_T *o_curwin;
! buf_T *o_curbuf;
#endif
int empty_line;
colnr_T virtcol;
--- 3915,3922 ----
char_u *t;
int byteval;
#ifdef FEAT_EVAL
! win_T *save_curwin;
! buf_T *save_curbuf;
#endif
int empty_line;
colnr_T virtcol;
***************
*** 3958,3963 ****
--- 3958,3966 ----
char_u tmp[TMPLEN];
char_u *usefmt = fmt;
struct stl_hlrec *sp;
+ int save_must_redraw = must_redraw;
+ int save_redr_type = curwin->w_redr_type;
+ int save_highlight_shcnaged = need_highlight_changed;
#ifdef FEAT_EVAL
/*
***************
*** 4267,4281 ****
vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum);
set_internal_string_var((char_u *)"actual_curbuf", tmp);
! o_curbuf = curbuf;
! o_curwin = curwin;
curwin = wp;
curbuf = wp->w_buffer;
str = eval_to_string_safe(p, &t, use_sandbox);
! curwin = o_curwin;
! curbuf = o_curbuf;
do_unlet((char_u *)"g:actual_curbuf", TRUE);
if (str != NULL && *str != 0)
--- 4270,4284 ----
vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum);
set_internal_string_var((char_u *)"actual_curbuf", tmp);
! save_curbuf = curbuf;
! save_curwin = curwin;
curwin = wp;
curbuf = wp->w_buffer;
str = eval_to_string_safe(p, &t, use_sandbox);
! curwin = save_curwin;
! curbuf = save_curbuf;
do_unlet((char_u *)"g:actual_curbuf", TRUE);
if (str != NULL && *str != 0)
***************
*** 4730,4735 ****
--- 4733,4745 ----
sp->userhl = 0;
}
+ /* 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;
+
return width;
}
#endif /* FEAT_STL_OPT */
*** ../vim-8.0.1072/src/version.c 2017-09-08 12:37:43.381853448 +0200
--- src/version.c 2017-09-08 13:54:30.455618497 +0200
***************
*** 771,772 ****
--- 771,774 ----
{ /* Add new patch number below this line */
+ /**/
+ 1073,
/**/
--
>From "know your smileys":
(X0||) Double hamburger with lettuce and tomato
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.