]> granicus.if.org Git - vim/commitdiff
patch 8.2.1853: "to_f" is recognized at "topleft" modifier v8.2.1853
authorBram Moolenaar <Bram@vim.org>
Fri, 16 Oct 2020 17:56:12 +0000 (19:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 16 Oct 2020 17:56:12 +0000 (19:56 +0200)
Problem:    "to_f" is recognized at "topleft" modifier.
Solution:   Do not recognize modifer when "_" follows. (closes #7019)

src/ex_docmd.c
src/testdir/test_vim9_assign.vim
src/version.c

index 1fc67eaec7a2f3d158edd86431741851a97999d2..66c0b667aec33975a673dde2cfa24e8cec33cb3c 100644 (file)
@@ -3123,7 +3123,7 @@ checkforcmd(
     for (i = 0; cmd[i] != NUL; ++i)
        if (((char_u *)cmd)[i] != (*pp)[i])
            break;
-    if (i >= len && !isalpha((*pp)[i]))
+    if (i >= len && !isalpha((*pp)[i]) && (*pp)[i] != '_')
     {
        *pp = skipwhite(*pp + i);
        return TRUE;
index cf06b5cd8919913d34d25b66db96bd6da6203357..478a1e5cd7a4aeb2eb3fc0bc84a6838af55dcfd1 100644 (file)
@@ -454,7 +454,6 @@ def Test_assignment_local()
 enddef
 
 def Test_assignment_default()
-
   # Test default values.
   var thebool: bool
   assert_equal(v:false, thebool)
@@ -571,6 +570,10 @@ def Test_assignment_vim9script()
     assert_equal(43, w)
     var t: number = 44
     assert_equal(44, t)
+
+    var to_var = 0
+    to_var = 3
+    assert_equal(3, to_var)
   END
   CheckScriptSuccess(lines)
 
index 266c7c135b39e099f6369d3b4069d2a3f2418960..5aa3cf669880d3f3e77d4b0aeca93888d0076446 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1853,
 /**/
     1852,
 /**/