0
0
mirror of https://github.com/vim/vim.git synced 2025-10-17 07:44:28 -04:00

patch 9.0.1196: code is indented more than necessary

Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11813)
This commit is contained in:
Yegappan Lakshmanan
2023-01-14 12:32:28 +00:00
committed by Bram Moolenaar
parent 378e6c03f9
commit e857598896
16 changed files with 678 additions and 676 deletions

View File

@@ -1119,59 +1119,59 @@ vim_beep(unsigned val)
called_vim_beep = TRUE;
#endif
if (emsg_silent == 0 && !in_assert_fails)
if (emsg_silent != 0 || in_assert_fails)
return;
if (!((bo_flags & val) || (bo_flags & BO_ALL)))
{
if (!((bo_flags & val) || (bo_flags & BO_ALL)))
{
#ifdef ELAPSED_FUNC
static int did_init = FALSE;
static elapsed_T start_tv;
static int did_init = FALSE;
static elapsed_T start_tv;
// Only beep once per half a second, otherwise a sequence of beeps
// would freeze Vim.
if (!did_init || ELAPSED_FUNC(start_tv) > 500)
{
did_init = TRUE;
ELAPSED_INIT(start_tv);
// Only beep once per half a second, otherwise a sequence of beeps
// would freeze Vim.
if (!did_init || ELAPSED_FUNC(start_tv) > 500)
{
did_init = TRUE;
ELAPSED_INIT(start_tv);
#endif
if (p_vb
if (p_vb
#ifdef FEAT_GUI
// While the GUI is starting up the termcap is set for
// the GUI but the output still goes to a terminal.
&& !(gui.in_use && gui.starting)
// While the GUI is starting up the termcap is set for
// the GUI but the output still goes to a terminal.
&& !(gui.in_use && gui.starting)
#endif
)
{
out_str_cf(T_VB);
)
{
out_str_cf(T_VB);
#ifdef FEAT_VTP
// No restore color information, refresh the screen.
if (has_vtp_working() != 0
// No restore color information, refresh the screen.
if (has_vtp_working() != 0
# ifdef FEAT_TERMGUICOLORS
&& (p_tgc || (!p_tgc && t_colors >= 256))
&& (p_tgc || (!p_tgc && t_colors >= 256))
# endif
)
{
redraw_later(UPD_CLEAR);
update_screen(0);
redrawcmd();
}
#endif
)
{
redraw_later(UPD_CLEAR);
update_screen(0);
redrawcmd();
}
else
out_char(BELL);
#ifdef ELAPSED_FUNC
}
#endif
}
else
out_char(BELL);
#ifdef ELAPSED_FUNC
}
#endif
}
// When 'debug' contains "beep" produce a message. If we are sourcing
// a script or executing a function give the user a hint where the beep
// comes from.
if (vim_strchr(p_debug, 'e') != NULL)
{
msg_source(HL_ATTR(HLF_W));
msg_attr(_("Beep!"), HL_ATTR(HLF_W));
}
// When 'debug' contains "beep" produce a message. If we are sourcing
// a script or executing a function give the user a hint where the beep
// comes from.
if (vim_strchr(p_debug, 'e') != NULL)
{
msg_source(HL_ATTR(HLF_W));
msg_attr(_("Beep!"), HL_ATTR(HLF_W));
}
}