]> granicus.if.org Git - vim/commitdiff
patch 8.2.4161: Vim9: warning for missing white space after imported variable v8.2.4161
authorBram Moolenaar <Bram@vim.org>
Thu, 20 Jan 2022 17:35:49 +0000 (17:35 +0000)
committerBram Moolenaar <Bram@vim.org>
Thu, 20 Jan 2022 17:35:49 +0000 (17:35 +0000)
Problem:    Vim9: warning for missing white space after imported variable.
Solution:   Do not skip white space. (closes #9567)

src/testdir/test_vim9_import.vim
src/version.c
src/vim9expr.c

index 49ff16508766e3d4c2f0aa3dcb6cccb957cbde8b..6a38106a7d82c0127e2839a36753d627c60a1c95 100644 (file)
@@ -67,6 +67,11 @@ def Test_vim9_import_export()
     enddef
     g:funcref_result = GetExported()
 
+    def GetName(): string
+      return expo.exp_name .. 'son'
+    enddef
+    g:long_name = GetName()
+
     g:imported_name = expo.exp_name
     expo.exp_name ..= ' Doe'
     expo.exp_name = expo.exp_name .. ' Maar'
@@ -98,6 +103,7 @@ def Test_vim9_import_export()
   assert_equal('Exported', g:imported_func)
   assert_equal('Exported', g:funcref_result)
   assert_equal('John', g:imported_name)
+  assert_equal('Johnson', g:long_name)
   assert_equal('John Doe Maar', g:imported_name_appended)
   assert_false(exists('g:name'))
 
@@ -109,7 +115,7 @@ def Test_vim9_import_export()
   unlet g:exported_i2
   unlet g:exported_later
   unlet g:imported_func
-  unlet g:imported_name g:imported_name_appended
+  unlet g:imported_name g:long_name g:imported_name_appended
   delete('Ximport.vim')
 
   # similar, with line breaks
index 901d671a5a9d3b02b74608963de8b59a74b6b039..fae00dc9d3b0d425a21cee14f64e0e7bf64096f2 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4161,
 /**/
     4160,
 /**/
index 7cc30780785e74a7ce52be5a988a153f54c08e4b..d5bb276b7df68d23670edb7d4e57a446c4217656 100644 (file)
@@ -321,7 +321,6 @@ compile_load_scriptvar(
                                                                   cctx, TRUE);
        }
        *p = cc;
-       p = skipwhite(p);
        *end = p;
        if (done)
            return res;