summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/eval.c3
-rw-r--r--src/testdir/test_messages.vim1
-rw-r--r--src/version.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 43c20086c..7130620c9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -4528,8 +4528,9 @@ echo_string_core(
case VAR_LIST:
if (tv->vval.v_list == NULL)
{
+ // NULL list is equivalent to empty list.
*tofree = NULL;
- r = NULL;
+ r = (char_u *)"[]";
}
else if (copyID != 0 && tv->vval.v_list->lv_copyID == copyID
&& tv->vval.v_list->lv_len > 0)
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index 32ffb48a8..ac91aa097 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -76,6 +76,7 @@ func Test_echomsg()
call assert_equal("\n12345", execute(':echomsg 12345'))
call assert_equal("\n[]", execute(':echomsg []'))
call assert_equal("\n[1, 2, 3]", execute(':echomsg [1, 2, 3]'))
+ call assert_equal("\n[1, 2, []]", execute(':echomsg [1, 2, test_null_list()]'))
call assert_equal("\n{}", execute(':echomsg {}'))
call assert_equal("\n{'a': 1, 'b': 2}", execute(':echomsg {"a": 1, "b": 2}'))
if has('float')
diff --git a/src/version.c b/src/version.c
index b7958da9b..c08008434 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 618,
+/**/
617,
/**/
616,