Patch 8.2.0618
Problem:    Echoing a null list results in no output. (Yegappan Lakshmanan)
Solution:   Return "[]" instead of NULL in echo_string_core(). 
Files:      src/eval.c, src/testdir/test_messages.vim


*** ../vim-8.2.0617/src/eval.c  2020-04-20 17:46:10.588551933 +0200
--- src/eval.c  2020-04-22 19:12:49.723469925 +0200
***************
*** 4528,4535 ****
        case VAR_LIST:
            if (tv->vval.v_list == NULL)
            {
                *tofree = NULL;
!               r = NULL;
            }
            else if (copyID != 0 && tv->vval.v_list->lv_copyID == copyID
                    && tv->vval.v_list->lv_len > 0)
--- 4528,4536 ----
        case VAR_LIST:
            if (tv->vval.v_list == NULL)
            {
+               // NULL list is equivalent to empty list.
                *tofree = NULL;
!               r = (char_u *)"[]";
            }
            else if (copyID != 0 && tv->vval.v_list->lv_copyID == copyID
                    && tv->vval.v_list->lv_len > 0)
*** ../vim-8.2.0617/src/testdir/test_messages.vim       2020-04-13 
19:55:47.567369413 +0200
--- src/testdir/test_messages.vim       2020-04-22 19:12:02.571576310 +0200
***************
*** 76,81 ****
--- 76,82 ----
    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')
*** ../vim-8.2.0617/src/version.c       2020-04-22 14:30:28.103278289 +0200
--- src/version.c       2020-04-22 19:01:56.532934888 +0200
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     618,
  /**/

-- 
The average life of an organization chart is six months.  You can safely
ignore any order from your boss that would take six months to complete.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202004221715.03MHFRE6012253%40masaka.moolenaar.net.

Raspunde prin e-mail lui