From 2a267d1cbfc3fcd64e02f4a93536a868da4ef2a4 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 4 Aug 2025 14:47:22 -0400 Subject: [PATCH] vim-patch:partial:8.2.1328: no space allowed before comma in list Problem: No space allowed before comma in list. Solution: Legacy Vim script allows it. (closes vim/vim#6577) https://github.com/vim/vim/commit/4d4d1cd5c8b61ef0296bd6190ca2a0b2d6d96ba7 Partial port to guard against v8.2.1326 regression. Co-authored-by: Bram Moolenaar --- test/old/testdir/test_listdict.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim index 678734dafb..4aa9baff84 100644 --- a/test/old/testdir/test_listdict.vim +++ b/test/old/testdir/test_listdict.vim @@ -26,6 +26,9 @@ func Test_list_create() call assert_equal(10, x) endfunc +" This was allowed in legacy Vim script +let s:list_with_spaces = [1 , 2 , 3] + " List slices func Test_list_slice() let l = [1, 'as''d', [1, 2, function("strlen")], {'a': 1},] @@ -340,6 +343,10 @@ func Test_dict() call assert_equal(#{g: x}, #{g:x}) endfunc +" This was allowed in legacy Vim script +let s:dict_with_spaces = {'one' : 1 , 'two' : 2 , 'three' : 3} +let s:dict_with_spaces_lit = #{one : 1 , two : 2 , three : 3} + " Dictionary identity func Test_dict_identity() let lines =<< trim END