Mercurial > vim
comparison src/misc1.c @ 13272:abaebba89fd4 v8.0.1510
patch 8.0.1510: cannot test if a command causes a beep
commit https://github.com/vim/vim/commit/b48e96f61c87a64e38e3ac50732c92a84a4833b8
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 13 12:26:14 2018 +0100
patch 8.0.1510: cannot test if a command causes a beep
Problem: Cannot test if a command causes a beep.
Solution: Add assert_beeps().
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Feb 2018 12:30:07 +0100 |
parents | ac42c4b11dbc |
children | 65c3e8259124 |
comparison
equal
deleted
inserted
replaced
13271:c716b01fb96d | 13272:abaebba89fd4 |
---|---|
3686 */ | 3686 */ |
3687 void | 3687 void |
3688 vim_beep( | 3688 vim_beep( |
3689 unsigned val) /* one of the BO_ values, e.g., BO_OPER */ | 3689 unsigned val) /* one of the BO_ values, e.g., BO_OPER */ |
3690 { | 3690 { |
3691 #ifdef FEAT_EVAL | |
3692 called_vim_beep = TRUE; | |
3693 #endif | |
3694 | |
3691 if (emsg_silent == 0) | 3695 if (emsg_silent == 0) |
3692 { | 3696 { |
3693 if (!((bo_flags & val) || (bo_flags & BO_ALL))) | 3697 if (!((bo_flags & val) || (bo_flags & BO_ALL))) |
3694 { | 3698 { |
3695 #ifdef ELAPSED_FUNC | 3699 #ifdef ELAPSED_FUNC |
3716 #ifdef ELAPSED_FUNC | 3720 #ifdef ELAPSED_FUNC |
3717 } | 3721 } |
3718 #endif | 3722 #endif |
3719 } | 3723 } |
3720 | 3724 |
3721 /* When 'verbose' is set and we are sourcing a script or executing a | 3725 /* When 'debug' contains "beep" produce a message. If we are sourcing |
3722 * function give the user a hint where the beep comes from. */ | 3726 * a script or executing a function give the user a hint where the beep |
3727 * comes from. */ | |
3723 if (vim_strchr(p_debug, 'e') != NULL) | 3728 if (vim_strchr(p_debug, 'e') != NULL) |
3724 { | 3729 { |
3725 msg_source(HL_ATTR(HLF_W)); | 3730 msg_source(HL_ATTR(HLF_W)); |
3726 msg_attr((char_u *)_("Beep!"), HL_ATTR(HLF_W)); | 3731 msg_attr((char_u *)_("Beep!"), HL_ATTR(HLF_W)); |
3727 } | 3732 } |