]> granicus.if.org Git - vim/commitdiff
patch 8.2.0672: heredoc in scripts does not accept lower case marker v8.2.0672
authorBram Moolenaar <Bram@vim.org>
Fri, 1 May 2020 12:10:13 +0000 (14:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 May 2020 12:10:13 +0000 (14:10 +0200)
Problem:    Heredoc in scripts does not accept lower case marker.
Solution:   Allow lower case only in non-Vim scripts. (Ken Takata,
            closes #6019)

src/evalvars.c
src/testdir/test_lua.vim
src/testdir/test_perl.vim
src/testdir/test_python2.vim
src/testdir/test_python3.vim
src/testdir/test_pyx2.vim
src/testdir/test_pyx3.vim
src/testdir/test_ruby.vim
src/version.c

index 7c8b9f7accb1cc787059473ae0fffb4b677a1bda..f6f077983b3c1df166adff4927b537e239a469dd 100644 (file)
@@ -595,7 +595,7 @@ heredoc_get(exarg_T *eap, char_u *cmd, int script_get)
            return NULL;
        }
        *p = NUL;
-       if (vim_islower(*marker))
+       if (!script_get && vim_islower(*marker))
        {
            emsg(_("E221: Marker cannot start with lower case letter"));
            return NULL;
index 44aae22f4db67b3b8754a530881c370fc60be246..25300b67eed1e3c9e2d0982f96d2f96acb30a0d3 100644 (file)
@@ -623,7 +623,10 @@ vim.command('let s ..= "B"')
   lua << trim
     vim.command('let s ..= "D"')
   .
-  call assert_equal('ABCD', s)
+  lua << trim eof
+    vim.command('let s ..= "E"')
+  eof
+  call assert_equal('ABCDE', s)
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 35cb813a113130d190a7d966290906edadb066c4..1a856d54704636c9f15ada687eb20ffd896ee876 100644 (file)
@@ -305,7 +305,10 @@ VIM::DoCommand('let s ..= "B"')
   perl << trim
     VIM::DoCommand('let s ..= "D"')
   .
-  call assert_equal('ABCD', s)
+  perl << trim eof
+    VIM::DoCommand('let s ..= "E"')
+  eof
+  call assert_equal('ABCDE', s)
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 7be5b4028e0e1bffd0a7b8411f9e89192164aed4..ae76fe6e89a82952ff7ad50ce8bcd080884c381f 100644 (file)
@@ -182,7 +182,10 @@ s+='B'
   python << trim
     s+='D'
   .
-  call assert_equal('ABCD', pyxeval('s'))
+  python << trim eof
+    s+='E'
+  eof
+  call assert_equal('ABCDE', pyxeval('s'))
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 224484611867c53fe21f1cceba57e15375771fa7..b4a4a4aa7b0fce9bef1c9234c6654d1b7bc738ec 100644 (file)
@@ -349,7 +349,10 @@ s+='B'
   python3 << trim
     s+='D'
   .
-  call assert_equal('ABCD', pyxeval('s'))
+  python3 << trim eof
+    s+='E'
+  eof
+  call assert_equal('ABCDE', pyxeval('s'))
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 93a2b899ea86e7bed0125a59f172587d9a1c1b88..7432ceba4a242497cf2b8e2cdd55b668ad27e521 100644 (file)
@@ -94,7 +94,10 @@ result+='B'
   pyx << trim
     result+='D'
   .
-  call assert_equal('ABCD', pyxeval('result'))
+  pyx << trim eof
+    result+='E'
+  eof
+  call assert_equal('ABCDE', pyxeval('result'))
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 5b983e40c0ce44a2f0f49fdf3ffd185c431ab777..5d38420dc26fc4469776ef1a319376099c89125e 100644 (file)
@@ -94,7 +94,10 @@ result+='B'
   pyx << trim
     result+='D'
   .
-  call assert_equal('ABCD', pyxeval('result'))
+  pyx << trim eof
+    result+='E'
+  eof
+  call assert_equal('ABCDE', pyxeval('result'))
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 100c9ea0fbe597b31315b254dfe8e00dd0444997..eee2831acf11312873e4b21282be313ee4eb2ead 100644 (file)
@@ -409,7 +409,10 @@ Vim.command('let s ..= "B"')
   ruby << trim
     Vim.command('let s ..= "D"')
   .
-  call assert_equal('ABCD', s)
+  ruby << trim eof
+    Vim.command('let s ..= "E"')
+  eof
+  call assert_equal('ABCDE', s)
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab
index 5e35da8a08b154a1617f0492281caeb103d48dcc..140871cdf14b91b252ee875f3785c6623efd92b5 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    672,
 /**/
     671,
 /**/