diff options
author | watiko <service@mail.watiko.net> | 2015-12-17 17:08:23 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-01-10 09:01:30 +0900 |
commit | 3a6cef9ee6de3ae577114a56343a9e336f900eac (patch) | |
tree | cb46d16350cad5703a9bbad8802bf3200c620f08 /src | |
parent | 2586459118ca589c8393121a5d3696802ed1a606 (diff) | |
download | rneovim-3a6cef9ee6de3ae577114a56343a9e336f900eac.tar.gz rneovim-3a6cef9ee6de3ae577114a56343a9e336f900eac.tar.bz2 rneovim-3a6cef9ee6de3ae577114a56343a9e336f900eac.zip |
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.
https://github.com/vim/vim/commit/cbfe32953aea09d35d9ac7e5865c915b14e310c1
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 19 | ||||
-rw-r--r-- | src/nvim/version.c | 32 |
2 files changed, 46 insertions, 5 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 22d3e7c91a..59b8d817cd 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -7992,10 +7992,19 @@ static void prepare_assert_error(garray_T *gap) char buf[NUMBUFLEN]; ga_init(gap, 1, 100); - ga_concat(gap, sourcing_name); - vim_snprintf(buf, ARRAY_SIZE(buf), " line %ld", (long)sourcing_lnum); - ga_concat(gap, (char_u *)buf); - ga_concat(gap, (char_u *)": "); + if (sourcing_name != NULL) { + ga_concat(gap, sourcing_name); + 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); diff --git a/src/nvim/version.c b/src/nvim/version.c index 4ba901cc0f..b6f4f2f5bb 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -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, |