To: vim_dev@googlegroups.com Subject: Patch 8.2.2931 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2931 Problem: Vim9: line continuation comment still uses legacy syntax in one place. Solution: Check for #\ instead of "\ earlier. (closes #8316) Files: src/scriptfile.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.2930/src/scriptfile.c 2021-06-02 15:28:11.651513682 +0200 --- src/scriptfile.c 2021-06-03 21:52:55.932835218 +0200 *************** *** 1788,1793 **** --- 1788,1795 ---- if (line != NULL && options != GETLINE_NONE && vim_strchr(p_cpo, CPO_CONCAT) == NULL) { + int comment_char = in_vim9script() ? '#' : '"'; + // compensate for the one line read-ahead --sp->sourcing_lnum; *************** *** 1800,1806 **** sp->nextline = get_one_sourceline(sp); if (sp->nextline != NULL && (*(p = skipwhite(sp->nextline)) == '\\' ! || (p[0] == '"' && p[1] == '\\' && p[2] == ' ') || (do_vim9_all && (*p == NUL || vim9_comment_start(p))) || (do_bar_cont && p[0] == '|' && p[1] != '|'))) --- 1802,1809 ---- sp->nextline = get_one_sourceline(sp); if (sp->nextline != NULL && (*(p = skipwhite(sp->nextline)) == '\\' ! || (p[0] == comment_char ! && p[1] == '\\' && p[2] == ' ') || (do_vim9_all && (*p == NUL || vim9_comment_start(p))) || (do_bar_cont && p[0] == '|' && p[1] != '|'))) *************** *** 1842,1848 **** ga_concat(&ga, p); } } ! else if (!(p[0] == (in_vim9script() ? '#' : '"') && p[1] == '\\' && p[2] == ' ') && !(do_vim9_all && (*p == NUL || vim9_comment_start(p)))) break; --- 1845,1851 ---- ga_concat(&ga, p); } } ! else if (!(p[0] == (comment_char) && p[1] == '\\' && p[2] == ' ') && !(do_vim9_all && (*p == NUL || vim9_comment_start(p)))) break; *** ../vim-8.2.2930/src/testdir/test_vim9_script.vim 2021-06-02 15:28:11.651513682 +0200 --- src/testdir/test_vim9_script.vim 2021-06-03 21:55:27.020509137 +0200 *************** *** 3081,3086 **** --- 3081,3089 ---- \ start='foo' #\ comment \ end='bar' + syn region Text start='foo' + #\ comment + \ end='bar' END CheckScriptSuccess(lines) *** ../vim-8.2.2930/src/version.c 2021-06-03 20:34:52.958850534 +0200 --- src/version.c 2021-06-03 21:55:55.904446706 +0200 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2931, /**/ -- A parent can be arrested if his child cannot hold back a burp during a church service. [real standing law in Nebraska, United States of America] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///