mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 05:48:17 +00:00
vim-patch:8.2.2694: when 'matchpairs' is empty every character beeps (#14279)
Problem: When 'matchpairs' is empty every character beeps. (Marco Hinz)
Solution: Bail out when no character in 'matchpairs' was found.
(closes vim/vim#8053) Add assert_nobeep().
5b8cabfef7
This commit is contained in:
@@ -391,28 +391,16 @@ static void f_argv(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
}
|
||||
|
||||
// "assert_beeps(cmd [, error])" function
|
||||
static void f_assert_beeps(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
const char *const cmd = tv_get_string_chk(&argvars[0]);
|
||||
garray_T ga;
|
||||
int ret = 0;
|
||||
rettv->vval.v_number = assert_beeps(argvars, false);
|
||||
}
|
||||
|
||||
called_vim_beep = false;
|
||||
suppress_errthrow = true;
|
||||
emsg_silent = false;
|
||||
do_cmdline_cmd(cmd);
|
||||
if (!called_vim_beep) {
|
||||
prepare_assert_error(&ga);
|
||||
ga_concat(&ga, (const char_u *)"command did not beep: ");
|
||||
ga_concat(&ga, (const char_u *)cmd);
|
||||
assert_error(&ga);
|
||||
ga_clear(&ga);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
suppress_errthrow = false;
|
||||
emsg_on_display = false;
|
||||
rettv->vval.v_number = ret;
|
||||
// "assert_nobeep(cmd [, error])" function
|
||||
static void f_assert_nobeep(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
rettv->vval.v_number = assert_beeps(argvars, true);
|
||||
}
|
||||
|
||||
// "assert_equal(expected, actual[, msg])" function
|
||||
|
Reference in New Issue
Block a user