patch 8.2.0618: echoing a null list results in no output
Problem: Echoing a null list results in no output. (Yegappan Lakshmanan)
Solution: Return "[]" instead of NULL in echo_string_core().
diff --git a/src/eval.c b/src/eval.c
index 43c2008..7130620 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -4528,8 +4528,9 @@
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)