changeset 22610:08e2363fd0de v8.2.1853

patch 8.2.1853: "to_f" is recognized at "topleft" modifier Commit: https://github.com/vim/vim/commit/7a66a17190f2f64688a697ea29d58388612122ce Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 16 19:56:12 2020 +0200 patch 8.2.1853: "to_f" is recognized at "topleft" modifier Problem: "to_f" is recognized at "topleft" modifier. Solution: Do not recognize modifer when "_" follows. (closes https://github.com/vim/vim/issues/7019)
author Bram Moolenaar <Bram@vim.org>
date Fri, 16 Oct 2020 20:00:04 +0200
parents 4757fd5c82c9
children 377667e0a347
files src/ex_docmd.c src/testdir/test_vim9_assign.vim src/version.c
diffstat 3 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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;
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -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)
 
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1853,
+/**/
     1852,
 /**/
     1851,