diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-06-03 21:56:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-06-03 21:56:10 +0200 |
commit | 5072b47a223fb044041b8e7db59a17b3b1d8a625 (patch) | |
tree | dbe8e9251fda2908ae694a21e8ca182d057305cf /src/scriptfile.c | |
parent | 85eee5b969485142b54337cadadd65a38e7d7396 (diff) | |
download | vim-git-5072b47a223fb044041b8e7db59a17b3b1d8a625.tar.gz |
patch 8.2.2931: Vim9: line continuation comment uses legacy syntaxv8.2.2931
Problem: Vim9: line continuation comment still uses legacy syntax in one
place.
Solution: Check for #\ instead of "\ earlier. (closes #8316)
Diffstat (limited to 'src/scriptfile.c')
-rw-r--r-- | src/scriptfile.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index 15338be63..bbc415664 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -1788,6 +1788,8 @@ getsourceline( 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,7 +1802,8 @@ getsourceline( sp->nextline = get_one_sourceline(sp); if (sp->nextline != NULL && (*(p = skipwhite(sp->nextline)) == '\\' - || (p[0] == '"' && p[1] == '\\' && p[2] == ' ') + || (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,7 +1845,7 @@ getsourceline( ga_concat(&ga, p); } } - else if (!(p[0] == (in_vim9script() ? '#' : '"') + else if (!(p[0] == (comment_char) && p[1] == '\\' && p[2] == ' ') && !(do_vim9_all && (*p == NUL || vim9_comment_start(p)))) break; |