To: vim_dev@googlegroups.com Subject: Patch 8.2.1379 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1379 Problem: Curly braces expression ending in " }" does not work. Solution: Skip over white space when checking for "}". (closes #6634) Files: src/dict.c, src/testdir/test_eval_stuff.vim *** ../vim-8.2.1378/src/dict.c 2020-07-30 22:14:29.576329749 +0200 --- src/dict.c 2020-08-06 15:55:51.878521956 +0200 *************** *** 817,823 **** { if (eval1(&start, &tv, NULL) == FAIL) // recursive! return FAIL; ! if (*start == '}') return NOTDONE; } --- 817,823 ---- { if (eval1(&start, &tv, NULL) == FAIL) // recursive! return FAIL; ! if (*skipwhite(start) == '}') return NOTDONE; } *** ../vim-8.2.1378/src/testdir/test_eval_stuff.vim 2020-07-11 22:25:53.403842060 +0200 --- src/testdir/test_eval_stuff.vim 2020-08-06 16:04:07.309044263 +0200 *************** *** 532,535 **** --- 532,557 ---- call assert_fails('call setreg(1, ["", "", [], ""])', 'E730:') endfunc + func Test_curly_assignment() + let s:svar = 'svar' + let g:gvar = 'gvar' + let lname = 'gvar' + let gname = 'gvar' + let {'s:'.lname} = {'g:'.gname} + call assert_equal('gvar', s:gvar) + let s:gvar = '' + let { 's:'.lname } = { 'g:'.gname } + call assert_equal('gvar', s:gvar) + let s:gvar = '' + let { 's:' . lname } = { 'g:' . gname } + call assert_equal('gvar', s:gvar) + let s:gvar = '' + let { 's:' .. lname } = { 'g:' .. gname } + call assert_equal('gvar', s:gvar) + + unlet s:svar + unlet s:gvar + unlet g:gvar + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1378/src/version.c 2020-08-06 11:23:30.575073657 +0200 --- src/version.c 2020-08-06 16:37:00.408671583 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1379, /**/ -- hundred-and-one symptoms of being an internet addict: 132. You come back and check this list every half-hour. /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///