File tree Expand file tree Collapse file tree 4 files changed +46
-4
lines changed
Expand file tree Collapse file tree 4 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -6779,17 +6779,17 @@ win_redr_status(win_T *wp)
67796779redraw_custom_statusline (win_T * wp )
67806780{
67816781 static int entered = FALSE;
6782- int save_called_emsg = called_emsg ;
6782+ int saved_did_emsg = did_emsg ;
67836783
67846784 /* When called recursively return. This can happen when the statusline
67856785 * contains an expression that triggers a redraw. */
67866786 if (entered )
67876787 return ;
67886788 entered = TRUE;
67896789
6790- called_emsg = FALSE;
6790+ did_emsg = FALSE;
67916791 win_redr_custom (wp , FALSE);
6792- if (called_emsg )
6792+ if (did_emsg )
67936793 {
67946794 /* When there is an error disable the statusline, otherwise the
67956795 * display is messed up with errors and a redraw triggers the problem
@@ -6798,7 +6798,7 @@ redraw_custom_statusline(win_T *wp)
67986798 (char_u * )"" , OPT_FREE | (* wp -> w_p_stl != NUL
67996799 ? OPT_LOCAL : OPT_GLOBAL ), SID_ERROR );
68006800 }
6801- called_emsg |= save_called_emsg ;
6801+ did_emsg |= saved_did_emsg ;
68026802 entered = FALSE;
68036803}
68046804#endif
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ source test_reltime.vim
2222source test_searchpos.vim
2323source test_set.vim
2424source test_sort.vim
25+ source test_statusline.vim
2526source test_syn_attr.vim
2627source test_timers.vim
2728source test_undolevels.vim
Original file line number Diff line number Diff line change 1+ function ! StatuslineWithCaughtError ()
2+ let s: func_in_statusline_called = 1
3+ try
4+ call eval (' unknown expression' )
5+ catch
6+ endtry
7+ return ' '
8+ endfunction
9+
10+ function ! StatuslineWithError ()
11+ let s: func_in_statusline_called = 1
12+ call eval (' unknown expression' )
13+ return ' '
14+ endfunction
15+
16+ function ! Test_caught_error_in_statusline ()
17+ let s: func_in_statusline_called = 0
18+ set laststatus = 2
19+ let statusline = ' %{StatuslineWithCaughtError()}'
20+ let &statusline = statusline
21+ redrawstatus
22+ call assert_true (s: func_in_statusline_called )
23+ call assert_equal (statusline , &statusline )
24+ set statusline =
25+ endfunction
26+
27+ function ! Test_statusline_will_be_disabled_with_error ()
28+ let s: func_in_statusline_called = 0
29+ set laststatus = 2
30+ let statusline = ' %{StatuslineWithError()}'
31+ try
32+ let &statusline = statusline
33+ redrawstatus
34+ catch
35+ endtry
36+ call assert_true (s: func_in_statusline_called )
37+ call assert_equal (' ' , &statusline )
38+ set statusline =
39+ endfunction
Original file line number Diff line number Diff line change @@ -748,6 +748,8 @@ static char *(features[]) =
748748
749749static int included_patches [] =
750750{ /* Add new patch number below this line */
751+ /**/
752+ 1711 ,
751753/**/
752754 1710 ,
753755/**/
You can’t perform that action at this time.
0 commit comments