mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +00:00
vim-patch:7.4.1032
Problem: message from assert_false() does not look nice.
Solution: Handle missing sourcing_name. Use right number of spaces. (Watiko)
Don't use line number if it's zero.
cbfe32953a
This commit is contained in:
@@ -7992,10 +7992,19 @@ static void prepare_assert_error(garray_T *gap)
|
||||
char buf[NUMBUFLEN];
|
||||
|
||||
ga_init(gap, 1, 100);
|
||||
if (sourcing_name != NULL) {
|
||||
ga_concat(gap, sourcing_name);
|
||||
vim_snprintf(buf, ARRAY_SIZE(buf), " line %ld", (long)sourcing_lnum);
|
||||
if (sourcing_lnum > 0) {
|
||||
ga_concat(gap, (char_u *)" ");
|
||||
}
|
||||
}
|
||||
if (sourcing_lnum > 0) {
|
||||
vim_snprintf(buf, ARRAY_SIZE(buf), "line %ld", (long)sourcing_lnum);
|
||||
ga_concat(gap, (char_u *)buf);
|
||||
}
|
||||
if (sourcing_name != NULL || sourcing_lnum > 0) {
|
||||
ga_concat(gap, (char_u *)": ");
|
||||
}
|
||||
}
|
||||
|
||||
// Fill "gap" with information about an assert error.
|
||||
@@ -8062,7 +8071,7 @@ static void assert_bool(typval_T *argvars, bool isTrue)
|
||||
(get_tv_number_chk(&argvars[0], &error) == 0) == isTrue || error) {
|
||||
prepare_assert_error(&ga);
|
||||
fill_assert_error(&ga, &argvars[1],
|
||||
(char_u *)(isTrue ? "True " : "False "),
|
||||
(char_u *)(isTrue ? "True" : "False"),
|
||||
NULL, &argvars[0]);
|
||||
assert_error(&ga);
|
||||
ga_clear(&ga);
|
||||
|
@@ -69,6 +69,38 @@ static char *features[] = {
|
||||
|
||||
// clang-format off
|
||||
static int included_patches[] = {
|
||||
1032,
|
||||
// 1031,
|
||||
// 1030,
|
||||
// 1029,
|
||||
// 1028,
|
||||
// 1027,
|
||||
// 1026,
|
||||
// 1025,
|
||||
// 1024,
|
||||
// 1023,
|
||||
// 1022,
|
||||
// 1021,
|
||||
// 1020,
|
||||
// 1019,
|
||||
// 1018,
|
||||
// 1017,
|
||||
// 1016,
|
||||
// 1015,
|
||||
// 1014,
|
||||
// 1013,
|
||||
// 1012,
|
||||
// 1011,
|
||||
// 1010,
|
||||
// 1009,
|
||||
// 1008,
|
||||
// 1007,
|
||||
// 1006,
|
||||
// 1005,
|
||||
// 1004,
|
||||
// 1003,
|
||||
// 1002,
|
||||
// 1001,
|
||||
// 1000,
|
||||
// 999 NA
|
||||
// 998,
|
||||
|
Reference in New Issue
Block a user