vim-patch:8.2.0035: saving and restoring called_emsg is clumsy (#19335)

Problem:    Saving and restoring called_emsg is clumsy.
Solution:   Count the number of error messages.
53989554a4
This commit is contained in:
zeertzjq
2022-07-13 04:08:49 +08:00
committed by GitHub
parent b1e0197a14
commit 39d51c833a
10 changed files with 26 additions and 49 deletions

View File

@@ -6533,13 +6533,11 @@ static void win_redr_ruler(win_T *wp, bool always)
}
if (*p_ruf && p_ch > 0 && !ui_has(kUIMessages)) {
int save_called_emsg = called_emsg;
called_emsg = false;
const int called_emsg_before = called_emsg;
win_redr_custom(wp, false, true);
if (called_emsg) {
if (called_emsg > called_emsg_before) {
set_string_option_direct("rulerformat", -1, "", OPT_FREE, SID_ERROR);
}
called_emsg |= save_called_emsg;
return;
}