To: vim_dev@googlegroups.com Subject: Patch 8.2.1437 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1437 Problem: Vim9: 'statusline' is evaluated using Vim9 script syntax. Solution: Always use legacy script syntax. Files: src/eval.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.1436/src/eval.c 2020-08-12 21:34:43.266489468 +0200 --- src/eval.c 2020-08-12 22:11:36.800433652 +0200 *************** *** 520,525 **** --- 520,526 ---- /* * Call eval_to_string() without using current local variables and using * textwinlock. When "use_sandbox" is TRUE use the sandbox. + * Use legacy Vim script syntax. */ char_u * eval_to_string_safe( *************** *** 528,534 **** --- 529,537 ---- { char_u *retval; funccal_entry_T funccal_entry; + int save_sc_version = current_sctx.sc_version; + current_sctx.sc_version = 1; save_funccal(&funccal_entry); if (use_sandbox) ++sandbox; *************** *** 538,543 **** --- 541,547 ---- --sandbox; --textwinlock; restore_funccal(); + current_sctx.sc_version = save_sc_version; return retval; } *** ../vim-8.2.1436/src/testdir/test_vim9_script.vim 2020-08-12 16:38:07.267186093 +0200 --- src/testdir/test_vim9_script.vim 2020-08-12 22:11:23.696530199 +0200 *************** *** 1086,1091 **** --- 1086,1105 ---- set errorformat& enddef + def Test_statusline_syntax() + # legacy syntax is used for 'statusline' + let lines =<< trim END + vim9script + func g:Status() + return '%{"x" is# "x"}' + endfunc + set laststatus=2 statusline=%!Status() + redrawstatus + set laststatus statusline= + END + CheckScriptSuccess(lines) + enddef + def Test_list_vimscript() # checks line continuation and comments let lines =<< trim END *** ../vim-8.2.1436/src/version.c 2020-08-12 21:58:09.000049823 +0200 --- src/version.c 2020-08-12 22:06:20.301968181 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1437, /**/ -- hundred-and-one symptoms of being an internet addict: 187. You promise yourself that you'll only stay online for another 15 minutes...at least once every 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 ///