summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-02 20:59:10 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-02 20:59:10 +0100
commitcbfe32953aea09d35d9ac7e5865c915b14e310c1 (patch)
treec280c3b1a470bab032c9e5c1738945adf65e242b
parent3c6f92e52ef15df4aa248ce00eacd65928044210 (diff)
downloadvim-git-cbfe32953aea09d35d9ac7e5865c915b14e310c1.tar.gz
patch 7.4.1032v7.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.
-rw-r--r--src/eval.c19
-rw-r--r--src/version.c2
2 files changed, 16 insertions, 5 deletions
diff --git a/src/eval.c b/src/eval.c
index c613f4adb..743c7436c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -9151,10 +9151,19 @@ prepare_assert_error(gap)
char buf[NUMBUFLEN];
ga_init2(gap, 1, 100);
- ga_concat(gap, sourcing_name);
- sprintf(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)
+ {
+ sprintf(buf, "line %ld", (long)sourcing_lnum);
+ ga_concat(gap, (char_u *)buf);
+ }
+ if (sourcing_name != NULL || sourcing_lnum > 0)
+ ga_concat(gap, (char_u *)": ");
}
/*
@@ -9243,7 +9252,7 @@ assert_bool(argvars, isTrue)
{
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/version.c b/src/version.c
index 6b225b336..72aa418d5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1032,
+/**/
1031,
/**/
1030,