vim-patch:8.0.1510: cannot assert beep #9938

Problem:    Cannot test if a command causes a beep.
Solution:   Add assert_beeps().
b48e96f61c
This commit is contained in:
Jan Edmund Lazo
2019-04-25 08:31:33 -04:00
committed by Justin M. Keyes
parent 24a9516ff4
commit 9d77a07686
7 changed files with 47 additions and 2 deletions

View File

@@ -2578,6 +2578,8 @@ void beep_flush(void)
// val is one of the BO_ values, e.g., BO_OPER
void vim_beep(unsigned val)
{
called_vim_beep = true;
if (emsg_silent == 0) {
if (!((bo_flags & val) || (bo_flags & BO_ALL))) {
if (p_vb) {
@@ -2587,8 +2589,9 @@ void vim_beep(unsigned val)
}
}
/* When 'verbose' is set and we are sourcing a script or executing a
* function give the user a hint where the beep comes from. */
// 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));