]> granicus.if.org Git - vim/commitdiff
patch 8.2.4552: in a :def function "put = expr" does not work v8.2.4552
authorBram Moolenaar <Bram@vim.org>
Sat, 12 Mar 2022 14:51:16 +0000 (14:51 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 Mar 2022 14:51:16 +0000 (14:51 +0000)
Problem:    In a :def function "put = expr" does not work.
Solution:   Skip over white space. (closes #9936)

src/testdir/test_vim9_cmd.vim
src/version.c
src/vim9cmds.c

index 92b834cb24f4b50486a04ce315e93a2516f7f411..47b6f779cbcacffeeb9cef29acd8e1cd1973a795 100644 (file)
@@ -1217,7 +1217,7 @@ def Test_put_command()
   :2put =['a', 'b', 'c']
   assert_equal(['ppp', 'a', 'b', 'c', 'above'], getline(2, 6))
 
-  :0put ='first'
+  :0put =  'first'
   assert_equal('first', getline(1))
   :1put! ='first again'
   assert_equal('first again', getline(1))
index 13f5da3d764de24782de78b66d0d460f0423ac33..acc5ccf6d6f9c5e475ba8a10cc557955e105bd34 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4552,
 /**/
     4551,
 /**/
index 5a44644599a661d16b4859fafb62d5018dcd0148..b8a511f27913246994cbba918f641cee5afd9f86 100644 (file)
@@ -1767,7 +1767,7 @@ compile_put(char_u *arg, exarg_T *eap, cctx_T *cctx)
 
     if (eap->regname == '=')
     {
-       char_u *p = line + 1;
+       char_u *p = skipwhite(line + 1);
 
        if (compile_expr0(&p, cctx) == FAIL)
            return NULL;